/* Authentication pages: shared design tokens and browser defaults */
:root {
    --auth-brand-50: #fff1f2;
    --auth-brand-300: #fda4af;
    --auth-brand-400: #fb7185;
    --auth-brand-500: #f43f5e;
    --auth-brand-600: #e11d48;
    --auth-brand-700: #be123c;
    --auth-brand-800: #9f1239;
    --auth-brand-900: #881337;
    --auth-dark: #111827;
    --auth-gray-50: #f9fafb;
    --auth-gray-100: #f3f4f6;
    --auth-gray-200: #e5e7eb;
    --auth-gray-300: #d1d5db;
    --auth-gray-400: #9ca3af;
    --auth-gray-500: #6b7280;
    --auth-gray-600: #4b5563;
    --auth-gray-700: #374151;
    --auth-gray-800: #1f2937;
    --auth-gray-900: #111827;
    --auth-white: #fff;
}

* {
    box-sizing: border-box;
}

html,
html.auth-document {
    scroll-behavior: smooth;
}

body,
h2,
p {
    margin: 0;
}

body.auth-page {
    display: flex;
    min-height: 100vh;
    flex-direction: column;
    justify-content: space-between;
    background: var(--auth-gray-50);
    color: var(--auth-gray-800);
    font-family: Inter, sans-serif;
    -webkit-font-smoothing: antialiased;
}

::selection {
    background: var(--auth-brand-600);
    color: var(--auth-white);
}

::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    border-radius: 4px;
    background: var(--auth-brand-700);
}

a {
    color: inherit;
    text-decoration: none;
}

button,
input {
    font: inherit;
}

/* Shared header and brand */
.auth-header {
    border-bottom: 1px solid var(--auth-gray-100);
    background: rgb(255 255 255 / 95%);
    box-shadow: 0 1px 2px rgb(0 0 0 / 5%);
    backdrop-filter: blur(12px);
}

.auth-header__container {
    width: 100%;
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 16px;
}

.auth-header__row {
    display: flex;
    height: 80px;
    align-items: center;
    justify-content: space-between;
}

.auth-brand {
    display: flex;
    align-items: center;
    gap: 10px;
}

.auth-brand__mark {
    display: flex;
    width: 40px;
    height: 40px;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    background: linear-gradient(45deg, var(--auth-brand-700), var(--auth-brand-600), var(--auth-brand-500));
    color: var(--auth-white);
    box-shadow: 0 10px 15px -3px rgb(225 29 72 / 30%);
    transition: transform .2s;
}

.auth-brand:hover .auth-brand__mark {
    transform: scale(1.05);
}

.auth-brand__icon {
    font-size: 20px;
}

.auth-brand__text {
    display: flex;
    flex-direction: column;
}

.auth-brand__name {
    color: var(--auth-gray-900);
    font-size: 24px;
    font-weight: 800;
    letter-spacing: -.025em;
    line-height: 1;
}

.auth-brand__accent,
.auth-link--accent {
    color: var(--auth-brand-600);
}

.auth-brand__tagline {
    margin-top: 2px;
    color: var(--auth-gray-400);
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.auth-back-link {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--auth-gray-600);
    font-size: 12px;
    font-weight: 700;
    transition: color .2s;
}

.auth-back-link:hover {
    color: var(--auth-brand-600);
}

/* Centered auth card and two-column layout */
.auth-main {
    display: flex;
    flex: 1;
    align-items: center;
    justify-content: center;
    padding: 48px 16px;
}

.auth-card {
    display: grid;
    width: 100%;
    max-width: 1024px;
    grid-template-columns: minmax(0, 1fr);
    overflow: hidden;
    border: 1px solid var(--auth-gray-100);
    border-radius: 24px;
    background: var(--auth-white);
    box-shadow: 0 25px 50px -12px rgb(0 0 0 / 25%);
}

/* Left brand story panel */
.auth-story {
    position: relative;
    display: flex;
    min-height: 360px;
    flex-direction: column;
    justify-content: space-between;
    overflow: hidden;
    padding: 32px;
    background: var(--auth-dark);
    color: var(--auth-white);
}

.auth-story__wash {
    position: absolute;
    z-index: 0;
    inset: 0;
    background: linear-gradient(135deg, rgb(136 19 55 / 90%), var(--auth-dark), #030712);
    opacity: .9;
}

.auth-story__glow {
    position: absolute;
    bottom: -96px;
    left: -96px;
    width: 288px;
    height: 288px;
    border-radius: 50%;
    background: rgb(225 29 72 / 30%);
    filter: blur(64px);
    pointer-events: none;
}

.auth-story__copy,
.auth-story__footer {
    position: relative;
    z-index: 1;
}

.auth-story__copy > * + * {
    margin-top: 16px;
}

.auth-eyebrow {
    display: inline-block;
    padding: 4px 12px;
    border: 1px solid rgb(244 63 94 / 40%);
    border-radius: 999px;
    background: rgb(136 19 55 / 80%);
    color: var(--auth-brand-300);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .05em;
    text-transform: uppercase;
}

.auth-story__title {
    color: var(--auth-white);
    font-size: 30px;
    font-weight: 800;
    letter-spacing: -.025em;
    line-height: 1.25;
}

.auth-story__description {
    color: var(--auth-gray-300);
    font-size: 12px;
    line-height: 1.625;
}

.auth-story__footer {
    padding-top: 40px;
}

.auth-story__footer p {
    color: var(--auth-gray-400);
    font-size: 12px;
}

.auth-link--light {
    color: var(--auth-brand-400);
    font-weight: 700;
}

.auth-link--light:hover,
.auth-link--accent:hover {
    text-decoration: underline;
}

.auth-link--underlined {
    text-decoration: underline;
}

.auth-story__links > * + * {
    margin-top: 8px;
}

/* Form panels, headings, and fields */
.auth-form-panel {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 32px;
}

.auth-form-heading {
    margin-bottom: 24px;
}

.auth-form-heading--spacious {
    margin-bottom: 32px;
}

.auth-form-title {
    color: var(--auth-gray-900);
    font-size: 24px;
    font-weight: 900;
}

.auth-form-subtitle {
    margin-top: 4px;
    color: var(--auth-gray-500);
    font-size: 12px;
}

.auth-form-note {
    color: var(--auth-gray-500);
    font-size: 12px;
    text-align: center;
}

.auth-form-note a {
    color: var(--auth-brand-600);
    font-weight: 700;
}

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

.auth-form > * + * {
    margin-top: 20px;
}

.auth-message {
    padding: 10px 12px;
    border: 1px solid transparent;
    border-radius: 10px;
    font-size: 12px;
    line-height: 1.5;
}

.auth-message[hidden] {
    display: none;
}

.auth-message--success {
    border-color: #a7f3d0;
    background: #ecfdf5;
    color: #047857;
}

.auth-message--success a {
    color: #065f46;
    font-weight: 700;
    text-decoration: underline;
}

.auth-message--failure {
    border-color: #fecaca;
    background: #fef2f2;
    color: #b91c1c;
}

.auth-form--compact > * + * {
    margin-top: 16px;
}

.auth-field-label {
    display: block;
    margin-bottom: 8px;
    color: var(--auth-gray-700);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .05em;
    text-transform: uppercase;
}

.auth-field-label--compact {
    margin-bottom: 6px;
}

.auth-input-wrap {
    position: relative;
}

.auth-input-wrap--phone {
    display: flex;
    align-items: center;
}

.auth-input-icon {
    position: absolute;
    z-index: 1;
    top: 0;
    bottom: 0;
    left: 14px;
    display: flex;
    align-items: center;
    color: var(--auth-gray-400);
}

.auth-input {
    display: block;
    width: 100%;
    border: 1px solid var(--auth-gray-200);
    border-radius: 12px;
    background: var(--auth-gray-50);
    color: var(--auth-gray-800);
    font-size: 12px;
    font-weight: 600;
    outline: none;
    transition: background-color .2s, border-color .2s, box-shadow .2s;
}

.auth-input--icon {
    padding: 12px 16px 12px 40px;
}

.auth-input--plain {
    padding: 10px 16px;
}

.auth-input--with-toggle {
    padding-right: 46px;
}

.auth-password-field {
    position: relative;
}

.auth-password-toggle {
    position: absolute;
    top: 50%;
    right: 12px;
    display: inline-flex;
    width: 28px;
    height: 28px;
    align-items: center;
    justify-content: center;
    padding: 0;
    transform: translateY(-50%);
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: var(--auth-gray-500);
    cursor: pointer;
}

.auth-password-toggle:hover {
    color: var(--auth-brand-600);
}

.auth-password-toggle:focus-visible {
    outline: 2px solid var(--auth-brand-600);
    outline-offset: 2px;
}

.auth-input--tall {
    padding-top: 14px;
    padding-bottom: 14px;
}

.auth-input--phone {
    padding: 14px 16px 14px 80px;
}

.auth-input:focus {
    border-color: var(--auth-brand-600);
    background: var(--auth-white);
    box-shadow: 0 0 0 2px var(--auth-brand-600);
}

.auth-country-code {
    position: absolute;
    left: 40px;
    padding: 0 8px 0 4px;
    border-right: 1px solid var(--auth-gray-200);
    color: var(--auth-gray-500);
    font-size: 12px;
    font-weight: 700;
}

.auth-password-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.auth-password-row .auth-field-label {
    margin-bottom: 0;
}

.auth-link--accent {
    font-size: 12px;
    font-weight: 700;
}

/* Checkboxes, action buttons, and sign-in divider */
.auth-checkbox-row {
    display: flex;
    align-items: center;
}

.auth-checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--auth-gray-600);
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
}

.auth-checkbox-label--small {
    font-size: 11px;
}

.auth-checkbox-label input {
    flex: 0 0 auto;
    width: 16px;
    height: 16px;
    accent-color: var(--auth-brand-600);
}

.auth-checkbox {
    border: 1px solid var(--auth-gray-300);
    border-radius: 4px;
}

.auth-checkbox-row--padded {
    padding-top: 4px;
}

.auth-button {
    display: block;
    width: 100%;
    border: 0;
    border-radius: 12px;
    background: var(--auth-brand-600);
    color: var(--auth-white);
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 10px 15px -3px rgb(225 29 72 / 30%);
    transition: background-color .2s, transform .2s;
}

.auth-button:hover {
    background: var(--auth-brand-700);
}

.auth-button:active {
    transform: scale(.99);
}

.auth-button--regular {
    padding: 14px 16px;
}

.auth-button--tall {
    padding: 14px 16px;
}

.auth-button--with-gap {
    margin-top: 8px;
}

.auth-divider {
    display: flex;
    align-items: center;
    padding: 8px 0;
}

.auth-divider__line {
    flex: 1;
    border-top: 1px solid var(--auth-gray-200);
}

.auth-divider__label {
    flex-shrink: 0;
    margin: 0 16px;
    color: var(--auth-gray-400);
    font-size: 11px;
    letter-spacing: .05em;
    text-transform: uppercase;
}

.auth-button--otp {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 12px 16px;
    border: 1px solid var(--auth-gray-200);
    background: var(--auth-white);
    color: var(--auth-gray-700);
    box-shadow: none;
}

.auth-button--otp:hover {
    background: var(--auth-gray-50);
}

/* Footer */
.auth-footer {
    border-top: 1px solid var(--auth-gray-800);
    padding: 24px 16px;
    background: var(--auth-gray-900);
    color: var(--auth-gray-400);
    font-size: 12px;
    text-align: center;
}

/* Responsive layout follows the original Tailwind breakpoints */
@media (min-width: 640px) {
    .auth-header__container {
        padding-right: 24px;
        padding-left: 24px;
    }

    .auth-main {
        padding-right: 24px;
        padding-left: 24px;
    }

    .auth-story__title {
        font-size: 36px;
    }

    .auth-story__description {
        font-size: 14px;
    }

    .auth-register-fields {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 16px;
    }
}

@media (min-width: 768px) {
    .auth-story,
    .auth-form-panel {
        padding: 48px;
    }
}

@media (min-width: 1024px) {
    .auth-header__container {
        padding-right: 32px;
        padding-left: 32px;
    }

    .auth-main {
        padding-right: 32px;
        padding-left: 32px;
    }

    .auth-card {
        grid-template-columns: repeat(12, minmax(0, 1fr));
    }

    .auth-story {
        grid-column: span 5;
        min-height: 0;
        padding: 48px;
    }

    .auth-form-panel {
        grid-column: span 7;
        padding: 48px;
    }
}

@media (max-width: 420px) {
    .auth-header__container {
        padding-right: 12px;
        padding-left: 12px;
    }

    .auth-brand__name {
        font-size: 20px;
    }

    .auth-back-link {
        gap: 5px;
        font-size: 11px;
    }

    .auth-main {
        padding: 24px 12px;
    }

    .auth-story,
    .auth-form-panel {
        padding: 24px;
    }
}
