/* =========================================================
   Authentication pages (Login / Register) - shared styles
   ========================================================= */

.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #7c3aed 100%);
    padding: 24px;
}

.auth-card {
    display: grid;
    grid-template-columns: 1.05fr 1fr;
    width: 100%;
    max-width: 940px;
    min-height: 600px;
    background: #ffffff;
    border-radius: 24px;
    overflow: hidden;
    box-shadow: 0 30px 80px rgba(30, 20, 80, 0.35);
}

/* ---------- Hero / brand panel ---------- */
.auth-hero {
    position: relative;
    background: linear-gradient(160deg, #4f46e5 0%, #7c3aed 100%);
    color: #ffffff;
    padding: 48px 44px;
    display: flex;
    align-items: center;
    overflow: hidden;
}

.auth-hero-content {
    position: relative;
    z-index: 2;
}

.auth-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 48px;
}

.auth-brand-icon {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.18);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 1.25rem;
}

.auth-brand-name {
    font-size: 1.35rem;
    font-weight: 700;
    letter-spacing: 0.3px;
}

.auth-hero-title {
    font-size: 2rem;
    line-height: 1.2;
    font-weight: 800;
    margin: 0 0 16px;
}

.auth-hero-subtitle {
    font-size: 0.95rem;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.85);
    margin: 0 0 32px;
    max-width: 340px;
}

.auth-hero-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.auth-hero-list li {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.95);
}

.auth-hero-list .tick {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    flex-shrink: 0;
}

/* decorative glow blobs */
.auth-hero-glow {
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    background:
        radial-gradient(circle at 85% 15%, rgba(255, 255, 255, 0.18), transparent 40%),
        radial-gradient(circle at 15% 90%, rgba(255, 255, 255, 0.12), transparent 45%);
}

/* ---------- Form panel ---------- */
.auth-form-panel {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 48px 44px;
    overflow-y: auto;
}

.auth-form-inner {
    width: 100%;
    max-width: 360px;
}

.auth-header {
    margin-bottom: 28px;
}

.auth-header h1 {
    font-size: 1.6rem;
    font-weight: 800;
    color: #1a1a2e;
    margin: 0 0 6px;
}

.auth-header p {
    color: #6c757d;
    font-size: 0.9rem;
    margin: 0;
}

.form-row {
    display: flex;
    gap: 12px;
}

.form-row .form-group {
    flex: 1;
}

.auth-form-inner .form-group {
    margin-bottom: 18px;
}

.auth-form-inner .form-group label {
    display: block;
    font-size: 0.8125rem;
    font-weight: 600;
    color: #1a1a2e;
    margin-bottom: 7px;
}

.input-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.input-icon {
    position: absolute;
    left: 14px;
    font-size: 0.95rem;
    opacity: 0.6;
    pointer-events: none;
}

.auth-form-inner .form-input,
.auth-form-inner select.form-input {
    width: 100%;
    padding: 12px 14px 12px 40px;
    border: 1.5px solid #e8eaed;
    border-radius: 12px;
    font-size: 0.9rem;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
    background: #fbfbfd;
    color: #1a1a2e;
}

.auth-form-inner .form-input:focus,
.auth-form-inner select.form-input:focus {
    border-color: #6366f1;
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.12);
    background: #ffffff;
}

.auth-form-inner .form-input.invalid {
    border-color: #ef4444;
}

.toggle-visibility {
    position: absolute;
    right: 10px;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    padding: 4px;
    opacity: 0.7;
}

.toggle-visibility:hover {
    opacity: 1;
}

.field-error {
    display: block;
    color: #ef4444;
    font-size: 0.75rem;
    margin-top: 5px;
}

.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 8px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 0.8125rem;
    color: #6c757d;
    cursor: pointer;
}

.checkbox-label input {
    accent-color: #6366f1;
    width: 15px;
    height: 15px;
}

.text-link {
    font-size: 0.8125rem;
    color: #6366f1;
    text-decoration: none;
    font-weight: 600;
}

.text-link:hover {
    text-decoration: underline;
}

.alert-error {
    background: #fef2f2;
    color: #dc2626;
    border: 1px solid #fecaca;
    padding: 10px 14px;
    border-radius: 10px;
    font-size: 0.8125rem;
    margin-bottom: 16px;
}

.alert-info {
    background: #eef2ff;
    color: #4f46e5;
    border: 1px solid #c7d2fe;
    padding: 10px 14px;
    border-radius: 10px;
    font-size: 0.8125rem;
    font-weight: 600;
    margin-bottom: 16px;
}

.alert-success {
    background: #f0fdf4;
    color: #16a34a;
    border: 1px solid #bbf7d0;
    padding: 10px 14px;
    border-radius: 10px;
    font-size: 0.8125rem;
    margin-bottom: 16px;
}

.btn-auth {
    width: 100%;
    padding: 13px;
    background: linear-gradient(135deg, #6366f1, #7c3aed);
    color: #ffffff;
    border: none;
    border-radius: 12px;
    font-weight: 700;
    font-size: 0.95rem;
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.2s, opacity 0.2s;
    box-shadow: 0 8px 20px rgba(99, 102, 241, 0.35);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.btn-auth:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 12px 26px rgba(99, 102, 241, 0.45);
}

.btn-auth:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.spinner {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.4);
    border-top-color: #ffffff;
    border-radius: 50%;
    animation: auth-spin 0.7s linear infinite;
}

@keyframes auth-spin {
    to { transform: rotate(360deg); }
}

/* Role selector (register) */
.role-toggle {
    display: flex;
    gap: 10px;
    margin-bottom: 18px;
}

.role-option {
    flex: 1;
    border: 1.5px solid #e8eaed;
    border-radius: 12px;
    padding: 12px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    background: #fbfbfd;
}

.role-option:hover {
    border-color: #c7d2fe;
}

.role-option.selected {
    border-color: #6366f1;
    background: #eef2ff;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.role-option .role-icon {
    font-size: 1.4rem;
    display: block;
    margin-bottom: 4px;
}

.role-option .role-label {
    font-size: 0.85rem;
    font-weight: 700;
    color: #1a1a2e;
}

.role-option .role-desc {
    font-size: 0.7rem;
    color: #6c757d;
}

/* Divider */
.auth-divider {
    display: flex;
    align-items: center;
    text-align: center;
    color: #adb5bd;
    font-size: 0.75rem;
    margin: 22px 0;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: #e8eaed;
}

.auth-divider span {
    padding: 0 12px;
}

.social-row {
    display: flex;
    gap: 12px;
}

.btn-social {
    flex: 1;
    padding: 11px;
    border: 1.5px solid #e8eaed;
    border-radius: 12px;
    background: #ffffff;
    font-size: 0.85rem;
    font-weight: 600;
    color: #1a1a2e;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: background 0.2s, border-color 0.2s;
}

.btn-social:hover {
    background: #f8f9fa;
    border-color: #d1d5db;
}

.social-icon {
    font-weight: 800;
    font-size: 1rem;
}

.auth-switch {
    text-align: center;
    margin-top: 22px;
    font-size: 0.85rem;
    color: #6c757d;
}

.auth-switch a {
    color: #6366f1;
    text-decoration: none;
    font-weight: 700;
}

.auth-switch a:hover {
    text-decoration: underline;
}

/* ---------- Responsive ---------- */
@media (max-width: 820px) {
    .auth-card {
        grid-template-columns: 1fr;
        max-width: 460px;
        min-height: 0;
    }

    /* Hide the tall hero on small screens, show a compact brand bar instead */
    .auth-hero {
        padding: 28px 32px;
        align-items: flex-start;
    }

    .auth-brand {
        margin-bottom: 20px;
    }

    .auth-hero-title {
        font-size: 1.4rem;
        margin-bottom: 8px;
    }

    .auth-hero-subtitle {
        margin-bottom: 0;
    }

    .auth-hero-list {
        display: none;
    }
}

@media (max-width: 480px) {
    .auth-page {
        padding: 0;
    }

    .auth-card {
        border-radius: 0;
        min-height: 100vh;
        box-shadow: none;
    }

    .auth-hero {
        display: none;
    }

    .auth-form-panel {
        padding: 32px 24px;
        min-height: 100vh;
    }

    .social-row {
        flex-direction: column;
    }
}

/* Inline link-styled button (used for the Terms & Privacy modal trigger) */
.link-button {
    background: none;
    border: none;
    padding: 0;
    font: inherit;
    cursor: pointer;
}

/* Terms & Privacy modal */
.terms-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(17, 24, 39, 0.55);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    z-index: 1000;
}

.terms-modal {
    background: #ffffff;
    border-radius: 16px;
    width: 100%;
    max-width: 640px;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
    overflow: hidden;
}

.terms-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 22px;
    border-bottom: 1px solid #eef0f3;
}

.terms-modal-header h2 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 700;
    color: #1a1a2e;
}

.terms-modal-close {
    width: 32px;
    height: 32px;
    border: none;
    background: #f1f3f5;
    border-radius: 50%;
    font-size: 1.3rem;
    line-height: 1;
    color: #4b5563;
    cursor: pointer;
}

.terms-modal-close:hover {
    background: #e5e7eb;
}

.terms-modal-body {
    padding: 20px 22px;
    overflow-y: auto;
}

.terms-updated {
    color: #8b93a1;
    font-size: 0.8rem;
    margin: 0 0 14px;
}

.terms-modal-body h3 {
    font-size: 0.95rem;
    font-weight: 700;
    color: #1a1a2e;
    margin: 16px 0 6px;
}

.terms-modal-body p {
    color: #4b5563;
    font-size: 0.875rem;
    line-height: 1.6;
    margin: 0 0 10px;
}

.terms-modal-body ul {
    margin: 0 0 10px;
    padding-left: 20px;
}

.terms-modal-body li {
    color: #4b5563;
    font-size: 0.875rem;
    line-height: 1.55;
    margin-bottom: 6px;
}

.terms-disclaimer {
    background: #fff7ed;
    border: 1px solid #fed7aa;
    border-radius: 10px;
    padding: 10px 12px;
    color: #9a3412 !important;
    font-size: 0.8rem !important;
    margin-top: 14px !important;
}

.terms-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 16px 22px;
    border-top: 1px solid #eef0f3;
}

.terms-agree-btn {
    padding: 10px 20px;
    background: #4f46e5;
    color: #ffffff;
    border: none;
    border-radius: 10px;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
}

.terms-agree-btn:hover {
    background: #4338ca;
}

.terms-close-btn {
    padding: 10px 20px;
    background: #f1f3f5;
    color: #4b5563;
    border: none;
    border-radius: 10px;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
}

.terms-close-btn:hover {
    background: #e5e7eb;
}

/* Terms row on sign-up: keep "I agree to the" and the Terms link together */
.form-options.terms-row {
    justify-content: flex-start;
    gap: 4px;
}

.form-options.terms-row .link-button {
    font-size: 0.8125rem;
}

/* =========================================================
   Login page — unique, scoped beautification (.login-page)
   Everything here is prefixed with .login-page so the shared
   Register page keeps its existing look.
   ========================================================= */

.login-page {
    position: relative;
    background: #0b0722;
    background-image:
        radial-gradient(circle at 20% 20%, rgba(124, 58, 237, 0.55), transparent 45%),
        radial-gradient(circle at 80% 15%, rgba(56, 189, 248, 0.40), transparent 45%),
        radial-gradient(circle at 75% 85%, rgba(236, 72, 153, 0.40), transparent 45%),
        radial-gradient(circle at 15% 80%, rgba(99, 102, 241, 0.45), transparent 45%),
        linear-gradient(135deg, #1e1b4b 0%, #312e81 45%, #4c1d95 100%);
    background-size: 200% 200%;
    animation: login-aurora 18s ease-in-out infinite;
    overflow: hidden;
}

@keyframes login-aurora {
    0%   { background-position: 0% 50%; }
    50%  { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* subtle grid overlay for depth */
.login-page::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.04) 1px, transparent 1px);
    background-size: 44px 44px;
    mask-image: radial-gradient(circle at 50% 40%, #000 0%, transparent 75%);
    -webkit-mask-image: radial-gradient(circle at 50% 40%, #000 0%, transparent 75%);
    pointer-events: none;
}

/* floating colour orbs behind the card */
.login-orbs {
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    filter: blur(8px);
}

.login-orb {
    position: absolute;
    border-radius: 50%;
    opacity: 0.55;
    mix-blend-mode: screen;
    animation: login-float 14s ease-in-out infinite;
}

.login-orb-1 {
    width: 320px; height: 320px;
    top: -60px; left: -40px;
    background: radial-gradient(circle at 30% 30%, #a78bfa, transparent 70%);
}

.login-orb-2 {
    width: 260px; height: 260px;
    bottom: -60px; right: 8%;
    background: radial-gradient(circle at 30% 30%, #38bdf8, transparent 70%);
    animation-delay: -4s;
}

.login-orb-3 {
    width: 220px; height: 220px;
    top: 40%; right: -50px;
    background: radial-gradient(circle at 30% 30%, #f472b6, transparent 70%);
    animation-delay: -8s;
}

@keyframes login-float {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33%      { transform: translate(30px, -24px) scale(1.06); }
    66%      { transform: translate(-22px, 18px) scale(0.96); }
}

/* the card floats above the animated backdrop as frosted glass */
.login-page .auth-card {
    position: relative;
    z-index: 1;
    max-width: 980px;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(22px) saturate(160%);
    -webkit-backdrop-filter: blur(22px) saturate(160%);
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: 28px;
    box-shadow:
        0 40px 90px rgba(10, 5, 40, 0.55),
        inset 0 1px 0 rgba(255, 255, 255, 0.6);
    animation: login-rise 0.7s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes login-rise {
    from { opacity: 0; transform: translateY(26px) scale(0.985); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* ---------- Hero panel makeover ---------- */
.login-page .auth-hero {
    background:
        linear-gradient(160deg, rgba(79, 70, 229, 0.96) 0%, rgba(124, 58, 237, 0.96) 60%, rgba(190, 24, 93, 0.92) 100%);
}

/* rotating conic glow behind hero content */
.login-page .auth-hero::after {
    content: '';
    position: absolute;
    width: 480px;
    height: 480px;
    top: -120px;
    right: -160px;
    background: conic-gradient(from 0deg, rgba(255,255,255,0.25), transparent 30%, rgba(255,255,255,0.18), transparent 70%, rgba(255,255,255,0.25));
    border-radius: 50%;
    opacity: 0.5;
    animation: login-spin 22s linear infinite;
    z-index: 1;
}

@keyframes login-spin {
    to { transform: rotate(360deg); }
}

.login-page .auth-hero-content {
    z-index: 2;
}

.login-page .auth-brand-icon {
    background: rgba(255, 255, 255, 0.22);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.18), inset 0 1px 0 rgba(255,255,255,0.5);
}

.login-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    margin-bottom: 18px;
    font-size: 0.75rem;
    font-weight: 600;
    color: #ffffff;
    background: rgba(255, 255, 255, 0.16);
    border: 1px solid rgba(255, 255, 255, 0.28);
    border-radius: 999px;
    backdrop-filter: blur(6px);
}

.login-page .auth-hero-title {
    font-size: 2.35rem;
    letter-spacing: -0.5px;
    text-shadow: 0 2px 20px rgba(0, 0, 0, 0.2);
}

/* ---------- Form panel polish ---------- */
.login-page .auth-header h1 {
    font-size: 1.75rem;
    background: linear-gradient(120deg, #4f46e5, #9333ea 60%, #db2777);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.login-page .auth-form-inner .form-input,
.login-page .auth-form-inner select.form-input {
    border-radius: 14px;
    border-color: #e6e3f5;
    background: #f7f6fd;
    transition: border-color 0.2s, box-shadow 0.2s, background 0.2s, transform 0.15s;
}

.login-page .auth-form-inner .form-input:focus,
.login-page .auth-form-inner select.form-input:focus {
    border-color: #8b5cf6;
    box-shadow: 0 0 0 4px rgba(139, 92, 246, 0.16);
    background: #ffffff;
}

.login-page .input-wrap:focus-within .input-icon {
    opacity: 1;
    transform: scale(1.05);
}

.login-page .input-icon {
    transition: opacity 0.2s, transform 0.2s;
}

/* shimmering primary button */
.login-page .btn-auth {
    position: relative;
    background: linear-gradient(135deg, #6366f1, #a21caf 55%, #db2777);
    background-size: 180% 180%;
    border-radius: 14px;
    box-shadow: 0 12px 26px rgba(124, 58, 237, 0.42);
    overflow: hidden;
    transition: transform 0.15s, box-shadow 0.2s, background-position 0.6s;
}

.login-page .btn-auth:hover:not(:disabled) {
    background-position: 100% 0;
    transform: translateY(-2px);
    box-shadow: 0 16px 34px rgba(124, 58, 237, 0.52);
}

/* sweeping sheen on the button */
.login-page .btn-auth::after {
    content: '';
    position: absolute;
    top: 0;
    left: -60%;
    width: 40%;
    height: 100%;
    background: linear-gradient(100deg, transparent, rgba(255, 255, 255, 0.45), transparent);
    transform: skewX(-20deg);
    animation: login-sheen 4.5s ease-in-out infinite;
}

@keyframes login-sheen {
    0%, 60% { left: -60%; }
    100%    { left: 130%; }
}

.login-page .auth-switch a,
.login-page .text-link {
    color: #7c3aed;
}

/* keep the frosted card readable on small screens */
@media (max-width: 480px) {
    .login-page .auth-card {
        background: #ffffff;
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
    }
    .login-page .auth-hero-title {
        font-size: 1.5rem;
    }
}

/* Phone field with a fixed +91 country-code prefix (India) */
.phone-wrap .phone-prefix {
    position: absolute;
    left: 38px;
    font-size: 0.9rem;
    font-weight: 600;
    color: #4b5563;
    pointer-events: none;
}

.phone-wrap .phone-input {
    /* leave room for the icon (left:14px) + the +91 prefix */
    padding-left: 72px;
    letter-spacing: 0.5px;
}
