:root {
    --auth-red: #d4281c;
    --auth-red-dark: #a51f15;
    --auth-cream: #f5f0e8;
    --auth-cream-dark: #ede7d9;
    --auth-ink: #0f0d0a;
    --auth-ink-soft: #2a2520;
    --auth-muted: #7a736a;
    --auth-white: #fdfcfa;
    --auth-border: rgba(15, 13, 10, 0.12);
    --auth-border-soft: rgba(255, 255, 255, 0.12);
    --auth-display: 'Inter', 'Segoe UI', sans-serif;
    --auth-body: 'Inter', 'Segoe UI', sans-serif;
}

body.auth-page.auth-ref-page {
    margin: 0;
    min-height: 100vh;
    display: grid;
    grid-template-columns: minmax(0, 1.04fr) minmax(0, 0.96fr);
    padding: 0;
    background: var(--auth-ink);
    color: var(--auth-ink);
    overflow-x: hidden;
    font-family: var(--auth-body);
}

.auth-ref-layout {
    display: contents;
}

.auth-ref-panel--brand {
    position: relative;
    overflow: hidden;
    display: grid;
    grid-template-rows: auto 1fr auto;
    height: 100vh;
    align-self: start;
    padding: 40px 48px 42px;
    background: var(--auth-ink);
    row-gap: 24px;
}

.auth-ref-panel--brand::before,
.auth-ref-panel--brand::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    background: var(--auth-red);
    pointer-events: none;
}

.auth-ref-panel--brand::before {
    top: -120px;
    left: -120px;
    width: 500px;
    height: 500px;
    opacity: 0.07;
    filter: blur(80px);
}

.auth-ref-panel--brand::after {
    right: -60px;
    bottom: -80px;
    width: 360px;
    height: 360px;
    opacity: 0.05;
    filter: blur(60px);
}

.auth-ref-grid {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
    background-size: 48px 48px;
    pointer-events: none;
}

.auth-ref-brand-top,
.auth-ref-brand-proof {
    position: relative;
    z-index: 1;
}

.auth-ref-brand-top {
    align-self: start;
}

.auth-ref-brand-proof {
    align-self: end;
}

.auth-ref-brand-mark {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 52px;
    text-decoration: none;
}

.auth-ref-brand-box {
    width: 42px;
    height: 42px;
    padding: 4px;
    border-radius: 11px;
    background: var(--auth-red);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 18px 40px rgba(212, 40, 28, 0.25);
}

.auth-ref-brand-box img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 8px;
}

.auth-ref-brand-name {
    font-family: var(--auth-display);
    font-size: 24px;
    font-weight: 800;
    letter-spacing: -0.03em;
    color: var(--auth-white);
}

.auth-ref-headline {
    max-width: 7ch;
    margin: 0 0 20px;
    font-family: var(--auth-display);
    font-size: clamp(50px, 4.9vw, 72px);
    font-weight: 800;
    line-height: 0.95;
    letter-spacing: -0.06em;
    color: var(--auth-white);
}

.auth-ref-headline em {
    font-style: normal;
    color: var(--auth-red);
}

.auth-ref-desc {
    max-width: 340px;
    margin: 0;
    font-size: 14px;
    line-height: 1.68;
    color: rgba(255, 255, 255, 0.46);
}

.auth-ref-features {
    display: grid;
    gap: 13px;
    margin-top: 38px;
}

.auth-ref-feature {
    display: flex;
    align-items: center;
    gap: 12px;
    color: rgba(255, 255, 255, 0.5);
    font-size: 13px;
    line-height: 1.5;
}

.auth-ref-feature-dot {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: rgba(212, 40, 28, 0.16);
    border: 1px solid rgba(212, 40, 28, 0.32);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.auth-ref-feature-dot::after {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--auth-red);
}

.auth-ref-proof-avatars {
    display: flex;
    margin-bottom: 14px;
}

.auth-ref-proof-avatar,
.auth-ref-proof-badge {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: 2.5px solid var(--auth-ink);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-family: var(--auth-display);
    font-size: 11px;
    font-weight: 800;
    color: var(--auth-white);
    flex-shrink: 0;
}

.auth-ref-proof-avatar {
    margin-right: -10px;
}

.auth-ref-proof-badge {
    width: auto;
    min-width: 38px;
    padding: 0 12px;
    background: rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.65);
}

.auth-ref-proof-text {
    margin: 0;
    font-size: 12.5px;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.42);
}

.auth-ref-proof-text strong {
    color: rgba(255, 255, 255, 0.78);
    font-weight: 600;
}

.auth-ref-panel--form {
    position: relative;
    min-height: 100vh;
    padding: 40px 56px;
    background: var(--auth-cream);
    display: flex;
    align-items: center;
    justify-content: center;
}

.auth-ref-panel--form::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 1px;
    height: 100%;
    background: var(--auth-border);
}

.auth-ref-form-wrap {
    width: 100%;
    max-width: 460px;
}

.auth-ref-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 34px;
    padding: 4px;
    border-radius: 14px;
    background: var(--auth-cream-dark);
}

.auth-ref-tab {
    flex: 1;
    min-height: 46px;
    padding: 10px 16px;
    border: none;
    border-radius: 10px;
    background: transparent;
    color: var(--auth-muted);
    text-align: center;
    text-decoration: none;
    font-size: 13px;
    font-weight: 700;
    transition: all 0.2s ease;
}

.auth-ref-tab.is-active {
    background: var(--auth-white);
    color: var(--auth-ink);
    box-shadow: 0 2px 8px rgba(15, 13, 10, 0.08);
}

.auth-ref-heading {
    margin: 0 0 8px;
    font-family: var(--auth-display);
    font-size: 34px;
    line-height: 1.06;
    letter-spacing: -0.05em;
    font-weight: 800;
    color: var(--auth-ink);
}

.auth-ref-subheading {
    margin: 0 0 30px;
    font-size: 14px;
    line-height: 1.7;
    color: var(--auth-muted);
}

.auth-ref-alert {
    margin-bottom: 18px;
}

.auth-ref-form-grid-2,
.auth-ref-form .form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.auth-ref-form .form-group {
    display: flex;
    flex-direction: column;
    gap: 7px;
    margin-bottom: 16px;
}

.auth-ref-form .form-row {
    margin-bottom: 16px;
}

.auth-ref-form .form-row .form-group {
    margin-bottom: 0;
}

.auth-ref-label,
.auth-ref-form .form-label,
.auth-ref-form label:not(.checkbox-label) {
    display: block;
    margin-bottom: 0;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    color: var(--auth-muted);
}

.auth-ref-label-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.auth-ref-form input[type="text"],
.auth-ref-form input[type="email"],
.auth-ref-form input[type="password"],
.auth-ref-form input[type="tel"],
.auth-ref-form input[type="number"],
.auth-ref-form select,
.auth-ref-form textarea {
    width: 100%;
    min-height: 48px;
    padding: 13px 16px;
    border: 1.5px solid var(--auth-border);
    border-radius: 12px;
    background: var(--auth-white);
    color: var(--auth-ink);
    box-shadow: none;
}

.auth-ref-form textarea {
    min-height: 112px;
}

.auth-ref-form input:focus,
.auth-ref-form select:focus,
.auth-ref-form textarea:focus {
    border-color: var(--auth-red);
    background: var(--auth-white);
    box-shadow: 0 0 0 3px rgba(212, 40, 28, 0.09);
}

.auth-ref-form input::placeholder,
.auth-ref-form textarea::placeholder {
    color: rgba(122, 115, 106, 0.7);
}

.auth-ref-form .input-icon-wrap {
    position: relative;
}

.auth-ref-form .input-icon-wrap input {
    padding-right: 48px;
}

.auth-ref-form .toggle-password {
    right: 14px;
    width: 24px;
    height: 24px;
    color: var(--auth-muted);
}

.auth-ref-form .toggle-password:hover {
    color: var(--auth-ink);
}

.auth-ref-forgot {
    color: var(--auth-red);
    font-size: 12px;
    font-weight: 700;
    text-decoration: none;
}

.auth-ref-forgot:hover,
.auth-ref-switch a:hover {
    opacity: 0.8;
}

.auth-ref-role-selector {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    margin-bottom: 24px;
}

.auth-ref-role-btn.role-tab {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 7px;
    min-height: 72px;
    padding: 10px 8px;
    border: 1.5px solid var(--auth-border);
    border-radius: 12px;
    background: var(--auth-white);
    color: var(--auth-muted);
    font-size: 11.5px;
    font-weight: 700;
    box-shadow: none;
}

.auth-ref-role-btn.role-tab.active {
    border-color: var(--auth-red);
    background: rgba(212, 40, 28, 0.04);
    color: var(--auth-red);
}

.auth-ref-role-icon {
    font-size: 15px;
    line-height: 1;
}

.auth-ref-strength {
    display: flex;
    gap: 4px;
    margin-top: 8px;
}

.auth-ref-strength-bar {
    height: 3px;
    flex: 1;
    border-radius: 999px;
    background: var(--auth-border);
}

.auth-ref-strength-bar.is-weak {
    background: var(--auth-red);
}

.auth-ref-strength-bar.is-medium {
    background: #c47f17;
}

.auth-ref-strength-bar.is-strong {
    background: #1a7a4a;
}

.auth-ref-checkbox {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin: 8px 0 24px;
}

.auth-ref-checkbox input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    margin-top: 1px;
    border: 1.5px solid var(--auth-border);
    border-radius: 5px;
    background: transparent;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
}

.auth-ref-checkbox input[type="checkbox"]:checked {
    border-color: var(--auth-red);
    background: var(--auth-red);
}

.auth-ref-checkbox input[type="checkbox"]:checked::after {
    content: '';
    width: 8px;
    height: 8px;
    border-radius: 2px;
    background: #fff;
}

.auth-ref-form .checkbox-label {
    display: block;
    color: var(--auth-muted);
    font-size: 13px;
    line-height: 1.55;
}

.auth-ref-form .checkbox-label a {
    color: var(--auth-red);
    font-weight: 700;
    text-decoration: none;
}

.auth-ref-submit {
    width: 100%;
    min-height: 52px;
    padding: 15px 18px;
    border: none;
    border-radius: 999px;
    background: var(--auth-red);
    color: var(--auth-white);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 15px;
    font-weight: 800;
    box-shadow: 0 8px 24px rgba(212, 40, 28, 0.3);
}

.auth-ref-submit:hover {
    background: var(--auth-red-dark);
    transform: translateY(-2px);
}

.auth-ref-google {
    width: 100%;
    min-height: 50px;
    padding: 13px 20px;
    border: 1.5px solid var(--auth-border);
    border-radius: 999px;
    background: var(--auth-white);
    color: var(--auth-ink);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-size: 14px;
    font-weight: 700;
    box-shadow: none;
}

.auth-ref-google:hover {
    background: var(--auth-cream-dark);
    border-color: rgba(15, 13, 10, 0.2);
}

/* Secondary action button (e.g. Resend OTP) — same neutral style as above, better name */
.auth-ref-secondary-btn {
    width: 100%;
    min-height: 50px;
    padding: 13px 20px;
    border: 1.5px solid var(--auth-border);
    border-radius: 999px;
    background: var(--auth-white);
    color: var(--auth-ink);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-size: 14px;
    font-weight: 700;
    box-shadow: none;
    cursor: pointer;
}
.auth-ref-secondary-btn:hover {
    background: var(--auth-cream-dark);
    border-color: rgba(15, 13, 10, 0.2);
}

.auth-ref-divider {
    display: flex;
    align-items: center;
    gap: 14px;
    margin: 20px 0;
    color: var(--auth-muted);
    font-size: 12px;
}

.auth-ref-divider::before,
.auth-ref-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--auth-border);
}

.auth-ref-switch {
    margin-top: 24px;
    text-align: center;
    color: var(--auth-muted);
    font-size: 13.5px;
}

.auth-ref-switch a {
    color: var(--auth-red);
    font-weight: 800;
    text-decoration: none;
}

.auth-ref-welcome-wrap {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    max-width: 430px;
    text-align: left;
}

.auth-ref-welcome-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 36px;
    padding: 8px 16px;
    margin-bottom: 28px;
    border-radius: 999px;
    border: 1px solid rgba(228, 52, 36, 0.18);
    background: rgba(228, 52, 36, 0.06);
    color: #e43424;
    font-size: 13px;
    font-weight: 500;
    letter-spacing: 0.01em;
    text-transform: none;
}

.auth-ref-welcome-badge::before {
    content: '';
    width: 10px;
    height: 10px;
    border-radius: 999px;
    background: #e43424;
    flex-shrink: 0;
}

.auth-ref-welcome-accent {
    width: 40px;
    height: 3px;
    margin-bottom: 34px;
    border-radius: 999px;
    background: #e43424;
}

.auth-ref-welcome-wrap .auth-ref-heading {
    margin-bottom: 20px;
    font-size: clamp(48px, 5.4vw, 62px);
    line-height: 0.98;
    letter-spacing: -0.05em;
}

.auth-ref-welcome-wrap .auth-ref-subheading {
    max-width: 520px;
    margin: 0 0 34px;
    color: #6f675c;
    font-size: 16px;
    line-height: 1.72;
}

.auth-ref-welcome-list {
    display: grid;
    gap: 14px;
    margin: 0 0 40px;
}

.auth-ref-welcome-list-item {
    display: flex;
    align-items: center;
    gap: 14px;
}

.auth-ref-welcome-check {
    width: 22px;
    height: 22px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #e43424;
    color: #fff;
    font-size: 13px;
    font-weight: 800;
    flex-shrink: 0;
}

.auth-ref-welcome-copy {
    margin: 0;
    max-width: none;
    color: #2a2116;
    font-size: 15px;
    line-height: 1.45;
}

.auth-ref-welcome-wrap .auth-ref-submit {
    width: min(100%, 426px);
    min-height: 60px;
    border-radius: 16px;
    justify-content: center;
    gap: 14px;
    font-size: 16px;
    font-weight: 700;
}

.auth-ref-form .field-error {
    display: none;
    margin-top: 2px;
    color: #b64149;
    font-size: 12px;
}

.auth-ref-form .field-status {
    margin-top: 2px;
}

@media (max-width: 900px) {
    body.auth-page.auth-ref-page {
        grid-template-columns: 1fr;
    }

    .auth-ref-panel--brand {
        display: none;
    }

    .auth-ref-panel--form {
        min-height: 100vh;
        padding: 40px 24px;
        background: var(--auth-ink);
    }

    .auth-ref-panel--form::before {
        display: none;
    }

    .auth-ref-heading {
        color: var(--auth-white);
    }

    .auth-ref-subheading {
        color: rgba(255, 255, 255, 0.45);
    }

    .auth-ref-tabs {
        background: rgba(255, 255, 255, 0.06);
    }

    .auth-ref-tab {
        color: rgba(255, 255, 255, 0.45);
    }

    .auth-ref-tab.is-active {
        background: rgba(255, 255, 255, 0.12);
        color: var(--auth-white);
        box-shadow: none;
    }

    .auth-ref-label,
    .auth-ref-form .form-label,
    .auth-ref-form label:not(.checkbox-label) {
        color: rgba(255, 255, 255, 0.42);
    }

    .auth-ref-form input[type="text"],
    .auth-ref-form input[type="email"],
    .auth-ref-form input[type="password"],
    .auth-ref-form input[type="tel"],
    .auth-ref-form input[type="number"],
    .auth-ref-form select,
    .auth-ref-form textarea,
    .auth-ref-role-btn.role-tab {
        background: rgba(255, 255, 255, 0.06);
        border-color: rgba(255, 255, 255, 0.12);
        color: var(--auth-white);
    }

    .auth-ref-role-btn.role-tab.active {
        background: rgba(212, 40, 28, 0.1);
        border-color: var(--auth-red);
        color: var(--auth-red);
    }

    .auth-ref-form input::placeholder,
    .auth-ref-form textarea::placeholder {
        color: rgba(255, 255, 255, 0.34);
    }

    .auth-ref-form input:focus,
    .auth-ref-form select:focus,
    .auth-ref-form textarea:focus {
        background: rgba(255, 255, 255, 0.1);
    }

    .auth-ref-form .toggle-password {
        color: rgba(255, 255, 255, 0.42);
    }

    .auth-ref-form .toggle-password:hover {
        color: rgba(255, 255, 255, 0.78);
    }

    .auth-ref-google {
        background: rgba(255, 255, 255, 0.06);
        border-color: rgba(255, 255, 255, 0.12);
        color: var(--auth-white);
    }

    .auth-ref-google:hover {
        background: rgba(255, 255, 255, 0.1);
        border-color: rgba(255, 255, 255, 0.22);
    }

    .auth-ref-divider,
    .auth-ref-switch,
    .auth-ref-form .checkbox-label {
        color: rgba(255, 255, 255, 0.42);
    }

    .auth-ref-welcome-wrap {
        max-width: none;
    }

    .auth-ref-welcome-wrap .auth-ref-subheading {
        color: rgba(255, 255, 255, 0.68);
    }

    .auth-ref-welcome-copy {
        color: rgba(255, 255, 255, 0.88);
    }

    .auth-ref-welcome-badge {
        border-color: rgba(255, 255, 255, 0.16);
        background: rgba(228, 52, 36, 0.12);
        color: #ff8f82;
    }

    .auth-ref-divider::before,
    .auth-ref-divider::after {
        background: rgba(255, 255, 255, 0.1);
    }

    .auth-ref-form .checkbox-label a,
    .auth-ref-forgot,
    .auth-ref-switch a {
        color: var(--auth-red);
    }
}

@media (max-width: 560px) {
    .auth-ref-panel--form {
        padding: 32px 20px;
    }

    .auth-ref-form-wrap {
        max-width: none;
    }

    .auth-ref-welcome-wrap .auth-ref-heading {
        font-size: clamp(38px, 12vw, 52px);
    }

    .auth-ref-welcome-wrap .auth-ref-subheading {
        font-size: 15px;
    }

    .auth-ref-welcome-wrap .auth-ref-submit {
        width: 100%;
    }

    .auth-ref-form-grid-2,
    .auth-ref-form .form-row {
        grid-template-columns: 1fr;
    }

    .auth-ref-role-selector {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}
