:root {
    --ink: #12110E;
    --ink-80: #2C2924;
    --ink-60: #57524A;
    --ink-40: #8C857B;
    --paper: #FAF8F5;
    --card: #FFFFFF;
    --amber: #F5A623;
    --amber-deep: #D97706;
    --amber-dark: #B45309;
    --amber-light: #FFF8EB;
    --amber-border: #F7D488;
    --line: #E8E3DA;
    --line-subtle: #F0ECE4;
    --radius-s: 10px;
    --radius-m: 16px;
    --radius-l: 24px;
    --radius-card: 32px;
    --radius-pill: 9999px;
    --shadow-card: 0 24px 60px -12px rgba(18, 17, 14, 0.12), 0 4px 20px rgba(18, 17, 14, 0.04);
    --shadow-amber: 0 8px 24px -4px rgba(18, 17, 14, 0.2);
    --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

button {
    font-family: inherit;
    border: none;
    cursor: pointer;
}

body {
    background-color: var(--paper);
    color: var(--ink);
    font-family: 'Plus Jakarta Sans', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
    line-height: 1.5;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
}

/* ── Header ── */
.login-header {
    background: rgba(250, 248, 245, 0.88);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--line-subtle);
    padding-top: calc(16px + env(safe-area-inset-top, 0px));
    padding-bottom: 16px;
    position: sticky;
    top: 0;
    z-index: 50;
}

@media (max-width: 680px) {
    .login-header {
        padding-top: calc(max(26px, env(safe-area-inset-top, 0px)) + 10px);
        padding-bottom: 12px;
    }

    .login-header-wrap {
        padding-inline: max(16px, env(safe-area-inset-left, 0px));
    }
}

.login-header-wrap {
    max-width: 1280px;
    margin: 0 auto;
    padding-inline: 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.login-logo {
    display: flex;
    align-items: center;
    text-decoration: none;
    transition: transform 0.2s ease;
}

.login-logo:hover {
    transform: scale(1.02);
}

.login-logo img {
    height: 36px;
    width: auto;
    display: block;
}

.back-home-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--ink-80);
    text-decoration: none;
    padding: 8px 18px;
    border-radius: var(--radius-pill);
    border: 1px solid var(--line);
    background: var(--card);
    box-shadow: 0 2px 6px rgba(18, 17, 14, 0.03);
    transition: all 0.18s var(--ease-out);
}

.back-home-link:hover {
    background: #FFFFFF;
    border-color: var(--amber-deep);
    color: var(--amber-deep);
    transform: translateX(-2px);
    box-shadow: 0 4px 12px rgba(28, 28, 30, 0.06);
}

/* ── Main Auth Stage ── */
.auth-main {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: clamp(24px, 4vw, 56px) 16px;
    position: relative;
    z-index: 1;
}

.auth-stage-container {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    max-width: 890px;
    margin: 0 auto;
    position: relative;
}

/* ── Dual-Panel Split Auth Card ── */
.auth-card {
    width: 100%;
    max-width: 880px;
    background: var(--card);
    border-radius: var(--radius-card);
    box-shadow: var(--shadow-card);
    border: 1px solid rgba(232, 227, 218, 0.85);
    display: flex;
    overflow: hidden;
    position: relative;
    min-height: 560px;
    animation: cardScaleIn 0.45s var(--ease-out);
    transition: all 0.4s var(--ease-out);
}

@keyframes cardScaleIn {
    from {
        opacity: 0;
        transform: translateY(14px) scale(0.99);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* ── Panel 1: Colored Curved Overlay Banner ── */
.card-overlay-pane {
    width: 45%;
    background: linear-gradient(135deg, #FFB800 0%, #D97706 100%);
    color: #FFFFFF;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 38px 32px;
    text-align: center;
    position: relative;
    z-index: 2;
    transition: all 0.4s var(--ease-out);
}

/* In Login mode on desktop: Amber panel is on the LEFT, curving into the right */
.auth-card.mode-login .card-overlay-pane {
    order: 1;
    border-radius: 0 100px 100px 0;
}

/* In Register mode on desktop: Amber panel is on the RIGHT, curving into the left */
.auth-card.mode-register .card-overlay-pane {
    order: 2;
    border-radius: 100px 0 0 100px;
}

.overlay-panel {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    max-width: 300px;
    animation: fadeIn 0.35s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: scale(0.96);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Character inside the Overlay Banner */
.overlay-character-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin: 8px 0 20px 0;
    user-select: none;
    pointer-events: none;
}

.overlay-char-img {
    width: clamp(145px, 18vw, 195px);
    max-height: min(235px, 30vh);
    object-fit: contain;
    filter: drop-shadow(0 12px 24px rgba(0, 0, 0, 0.18));
}

.overlay-char-shadow {
    width: 76px;
    height: 8px;
    background: radial-gradient(ellipse at center, rgba(0, 0, 0, 0.22) 0%, transparent 70%);
    border-radius: 50%;
    margin-top: -4px;
}

.overlay-heading {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 2.05rem;
    font-weight: 800;
    line-height: 1.15;
    letter-spacing: -0.02em;
    margin-bottom: 6px;
    color: #FFFFFF;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}

.overlay-sub {
    font-size: 0.92rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.92);
    margin-top: 14px;
    margin-bottom: 0;
    line-height: 1.45;
}

/* The Ghost Outline Pill Button from the reference design */
.btn-ghost-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 11px 34px;
    border: 2px solid #FFFFFF;
    border-radius: var(--radius-pill);
    background: transparent;
    color: #FFFFFF;
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 0.95rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    cursor: pointer;
    transition: all 0.22s var(--ease-out);
}

.btn-ghost-pill:hover {
    background: #FFFFFF;
    color: var(--amber-deep);
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.15);
}

.btn-ghost-pill:active {
    transform: translateY(0);
}

/* ── Panel 2: Form Panel (White Side) ── */
.card-form-pane {
    width: 55%;
    padding: 38px 42px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: relative;
    z-index: 1;
    transition: all 0.4s var(--ease-out);
}

.auth-card.mode-login .card-form-pane {
    order: 2;
}

.auth-card.mode-register .card-form-pane {
    order: 1;
}

/* Role Selector Bar */
.role-selector-bar {
    margin-bottom: 16px;
}

.role-bar-label {
    display: block;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--ink-40);
    margin-bottom: 8px;
    text-align: center;
}

.role-pills {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    background: #F4F1EA;
    padding: 4px;
    border-radius: var(--radius-pill);
    border: 1px solid #ECE7DE;
}

.role-pill-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 9px 14px;
    border-radius: var(--radius-pill);
    background: transparent;
    border: none;
    color: var(--ink-60);
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s var(--ease-out);
}

.role-pill-svg {
    flex-shrink: 0;
    color: inherit;
    transition: transform 0.2s ease, stroke 0.2s ease;
}

.role-pill-btn:hover {
    color: var(--ink);
}

.role-pill-btn:hover .role-pill-svg {
    transform: scale(1.1);
}

.role-pill-btn.active {
    background: #FFFFFF;
    color: var(--amber-deep);
    box-shadow: 0 2px 8px rgba(28, 28, 30, 0.07), 0 1px 2px rgba(18, 17, 14, 0.04);
}

.role-pill-btn.active .role-pill-svg {
    stroke: var(--amber-deep);
}

/* Form Titles */
.form-title {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 1.85rem;
    font-weight: 800;
    letter-spacing: -0.025em;
    color: var(--ink);
    text-align: center;
    margin-bottom: 18px;
}

/* Notification Messages */
.auth-msg {
    padding: 10px 14px;
    border-radius: var(--radius-s);
    font-size: 0.85rem;
    font-weight: 600;
    display: none;
    margin-bottom: 14px;
    animation: msgFade 0.2s ease-out;
}

@keyframes msgFade {
    from {
        opacity: 0;
        transform: translateY(-4px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.auth-msg-error {
    background: #FDF2F2;
    border: 1px solid #F8B4B4;
    color: #9B1C1C;
}

.auth-msg-success {
    background: #F3FAF7;
    border: 1px solid #84E1BC;
    color: #0E9F6E;
}

/* Form Inputs */
.auth-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.form-group {
    display: flex;
    flex-direction: column;
}

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

.input-icon-right {
    position: absolute;
    right: 14px;
    color: var(--ink-40);
    pointer-events: none;
    display: flex;
    align-items: center;
    transition: color 0.15s ease;
}

.form-input {
    width: 100%;
    padding: 13px 42px 13px 18px;
    border-radius: 12px;
    border: 1.5px solid var(--line);
    background: #F4F1EA;
    font-family: inherit;
    font-size: 0.94rem;
    font-weight: 500;
    color: var(--ink);
    transition: all 0.18s ease;
}

.form-input:hover {
    background: #FFFFFF;
    border-color: #D3CDC2;
}

.form-input:focus {
    outline: none;
    background: #FFFFFF;
    border-color: var(--amber-deep);
    box-shadow: 0 0 0 3.5px rgba(217, 119, 6, 0.15);
}

.form-input:focus~.input-icon-right {
    color: var(--amber-deep);
}

.form-input::placeholder {
    color: var(--ink-40);
    font-weight: 400;
}

.form-input-password {
    padding-right: 44px;
}

/* Password Toggle Button */
.password-toggle-btn {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    outline: none;
    padding: 6px;
    cursor: pointer;
    color: var(--ink-40);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: all 0.15s ease;
    z-index: 2;
}

.password-toggle-btn:hover {
    color: var(--ink);
    background-color: rgba(18, 17, 14, 0.06);
}

.password-toggle-btn .eye-icon {
    display: block;
    pointer-events: none;
}

/* Forgot Password Row */
.forgot-row {
    text-align: center;
    margin-top: 4px;
    margin-bottom: 2px;
}

.forgot-password-link {
    background: none;
    border: none;
    padding: 4px;
    font-family: inherit;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--ink-60);
    cursor: pointer;
    text-decoration: none;
    transition: color 0.15s ease;
}

.forgot-password-link:hover {
    color: var(--amber-deep);
    text-decoration: underline;
}

/* Primary Action Button (Matches website theme) */
.btn-auth-submit {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 14px 20px;
    border: none;
    outline: none;
    border-radius: 12px;
    background: linear-gradient(135deg, #FFB800 0%, #D97706 100%);
    color: #FFFFFF;
    font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
    font-size: 0.98rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    cursor: pointer;
    box-shadow: var(--shadow-amber);
    transition: all 0.22s var(--ease-out);
    margin-top: 6px;
}

.btn-auth-submit:hover {
    background: linear-gradient(135deg, #FFC01E 0%, #B45309 100%);
    transform: translateY(-1.5px);
    box-shadow: 0 10px 28px rgba(28, 28, 30, 0.2);
}

.btn-auth-submit:active {
    transform: translateY(0);
    box-shadow: 0 3px 10px rgba(28, 28, 30, 0.11);
}

.btn-auth-submit:disabled {
    opacity: 0.65;
    cursor: not-allowed;
    transform: none;
}

/* ── Social Login Block (From Reference Image) ── */
.social-login-block {
    text-align: center;
    margin-top: 20px;
}

.social-title {
    font-size: 0.78rem;
    color: var(--ink-40);
    font-weight: 500;
    margin-bottom: 12px;
}

.social-btn-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.social-btn {
    width: 42px;
    height: 42px;
    border-radius: 10px;
    border: 1px solid var(--line);
    background: #FFFFFF;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(18, 17, 14, 0.03);
    transition: all 0.18s var(--ease-out);
}

.social-btn:hover {
    border-color: var(--amber-deep);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(18, 17, 14, 0.08);
}

/* ── Forgot Password Modal ── */
.auth-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 1000;
    background: rgba(18, 17, 14, 0.55);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s var(--ease-out), visibility 0.25s var(--ease-out);
}

.auth-modal-overlay.open {
    opacity: 1;
    visibility: visible;
}

.auth-modal-card {
    width: 100%;
    max-width: 440px;
    background: var(--card);
    border-radius: var(--radius-l);
    padding: 32px 28px;
    box-shadow: 0 24px 60px rgba(18, 17, 14, 0.2), 0 0 0 1px rgba(18, 17, 14, 0.05);
    border: 1.5px solid var(--amber-border);
    transform: scale(0.94) translateY(12px);
    transition: transform 0.25s var(--ease-out);
    position: relative;
}

.auth-modal-overlay.open .auth-modal-card {
    transform: scale(1) translateY(0);
}

.auth-modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 1px solid var(--line);
    background: var(--paper);
    color: var(--ink-60);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.15s ease;
}

.auth-modal-close:hover {
    background: #FFFFFF;
    color: var(--ink);
    border-color: var(--amber-border);
}

.auth-modal-icon-badge {
    width: 52px;
    height: 52px;
    color: var(--amber-deep);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
}

.auth-modal-icon-badge svg {
    stroke-width: 2.6;
}

.auth-modal-header {
    text-align: center;
    margin-bottom: 20px;
}

.auth-modal-title {
    font-size: 1.35rem;
    font-weight: 800;
    color: var(--ink);
    letter-spacing: -0.02em;
    margin-bottom: 6px;
}

.auth-modal-desc {
    font-size: 0.88rem;
    color: var(--ink-60);
    line-height: 1.45;
}

.forgot-success-box {
    text-align: center;
    padding: 8px 4px;
}

.forgot-success-icon {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: #DEF7EC;
    border: 2px solid #84E1BC;
    color: #0E9F6E;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
}

.forgot-success-text {
    font-size: 0.9rem;
    color: var(--ink-60);
    line-height: 1.5;
    margin-bottom: 18px;
}

.forgot-success-text strong {
    color: var(--ink);
    word-break: break-all;
}

.resend-text {
    font-size: 0.82rem;
    color: var(--ink-40);
    margin-top: 14px;
}

.resend-btn {
    background: none;
    border: none;
    color: var(--amber-deep);
    font-weight: 700;
    cursor: pointer;
    font-family: inherit;
    font-size: inherit;
    padding: 0;
    text-decoration: underline;
}

.resend-btn:hover {
    color: var(--amber-dark);
}

/* ── Mobile Layout (Matches Phone Mockup in Reference) ── */
@media (max-width: 820px) {
    .auth-main {
        padding: 16px 12px;
    }

    .auth-card {
        flex-direction: column;
        max-width: 440px;
        min-height: auto;
        border-radius: 28px;
    }

    /* In mobile layout: The amber curved banner is ALWAYS on top, curving down */
    .auth-card.mode-login .card-overlay-pane,
    .auth-card.mode-register .card-overlay-pane {
        width: 100%;
        order: 1 !important;
        border-radius: 0 0 50% 50% / 0 0 36px 36px !important;
        padding: 26px 20px 24px !important;
    }

    .overlay-char-img {
        width: 130px;
        max-height: 160px;
    }

    .overlay-heading {
        font-size: 1.65rem;
        margin-bottom: 6px;
    }

    .overlay-sub {
        font-size: 0.86rem;
        margin-top: 10px;
        margin-bottom: 0;
    }

    /* Form panel is below the curved banner */
    .card-form-pane {
        width: 100%;
        order: 2 !important;
        padding: 26px 20px 28px;
    }

    .form-title {
        font-size: 1.6rem;
        margin-bottom: 14px;
    }
}