:root {
    --color-primary: #2a3283;
    --color-primary-dark: #11196d;
    --color-brand-pink: #b3589a;
    --color-brand-pink-hover: #9e4a87;
    --color-brand-blue: #3b4ba0;
    --color-link: #3b4ba0;
    --color-link-hover: #2f3d88;
    --color-text: #1a1d2e;
    --color-text-muted: #5c6178;
    --color-border: #c5c9d9;
    --color-bg: #f0f1f5;
    --color-white: #ffffff;
    --color-success: #1d7a4d;
    --color-warning: #c27a00;
    --color-error-bg: #fef2f2;
    --color-error-text: #b91c1c;
    --font-family: 'Open Sans', system-ui, sans-serif;
    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 10px;
    --auth-content-width: 300px;
    --auth-card-padding-x: 32px;
    --auth-card-padding-y: 32px;
    --card-max: calc(var(--auth-content-width) + (var(--auth-card-padding-x) * 2));
    --auth-layout-gap: 20px;
}

[hidden] {
    display: none !important;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    min-height: 100%;
}

body.auth-page {
    font-family: var(--font-family);
    color: var(--color-text);
    background: var(--color-bg);
    overflow-x: hidden;
}

/* Figma: Clean Variant — centered logo + card */
.auth-shell--centered {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    min-height: 100dvh;
    width: 100%;
    padding: 16px 24px;
    overflow: visible;
}

.auth-page-layout {
    display: flex;
    flex: 0 0 auto;
    flex-direction: column;
    align-items: stretch;
    justify-content: center;
    gap: var(--auth-layout-gap);
    width: 100%;
    max-width: var(--card-max);
}

.auth-page-header {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    margin: 0;
    padding: 0;
}

.auth-logo-wrap {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    line-height: 0;
    background: none;
}

.auth-logo-full {
    display: block;
    width: var(--auth-content-width);
    max-width: 100%;
    height: auto;
    margin: 0;
    object-fit: contain;
    background: transparent;
}

.auth-card {
    width: 100%;
    background: var(--color-white);
    border: 1px solid #e4e6ee;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(17, 25, 109, 0.08);
    padding: var(--auth-card-padding-y) var(--auth-card-padding-x);
    overflow: hidden;
}

.auth-card__header {
    margin-bottom: 0;
}

.auth-card__header h1 {
    margin: 0 0 4px;
    font-size: 20px;
    font-weight: 600;
    line-height: 1.3;
    color: var(--color-primary-dark);
}

.auth-card__header p {
    margin: 0;
    font-size: 14px;
    line-height: 1.45;
    color: var(--color-text-muted);
}

.auth-alert {
    margin: 0 0 20px;
    padding: 12px 14px;
    border-radius: var(--radius-md);
    font-size: 16px;
}

.auth-alert--error {
    background: var(--color-error-bg);
    color: var(--color-error-text);
    font-weight: 700;
}

.auth-alert--success {
    background: #ecfdf5;
    color: #065f46;
    font-weight: 600;
}

.auth-alert--warning {
    background: #fffbeb;
    color: #92400e;
    font-weight: 600;
}

.auth-alert p {
    margin: 0;
    font-weight: 700;
}

.auth-alert p + p {
    margin-top: 4px;
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 18px;
    margin: 0;
}

.auth-field {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.auth-field label {
    font-size: 14px;
    font-weight: 600;
    line-height: 1.3;
    color: var(--color-text);
}

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

.auth-info-wrap {
    position: relative;
    flex-shrink: 0;
}

.auth-info-btn {
    width: 20px;
    height: 20px;
    border: 1px solid #9ca3af;
    border-radius: 50%;
    background: transparent;
    color: #6b7280;
    font-size: 12px;
    font-weight: 700;
    font-style: italic;
    font-family: Georgia, 'Times New Roman', serif;
    line-height: 1;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease;
}

.auth-info-btn:hover,
.auth-info-btn:focus-visible {
    border-color: var(--color-brand-blue);
    color: var(--color-brand-blue);
    outline: none;
}

.auth-info-btn[aria-expanded='true'] {
    border-color: var(--color-brand-blue);
    color: var(--color-white);
    background: var(--color-brand-blue);
}

.auth-password-input-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.auth-password-input-row .auth-input-wrap {
    flex: 1;
    min-width: 0;
}

.auth-password-input-row .auth-info-wrap {
    flex-shrink: 0;
}

.auth-password-input-row .auth-tooltip {
    right: 0;
    left: auto;
}

.auth-tooltip {
    position: absolute;
    z-index: 30;
    right: 0;
    top: calc(100% + 8px);
    width: max(220px, 16rem);
    max-width: min(280px, 90vw);
    padding: 10px 12px;
    font-size: 13px;
    font-weight: 400;
    line-height: 1.45;
    color: var(--color-text);
    background: var(--color-white);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.12);
}

.auth-tooltip__title {
    margin: 0 0 6px;
    font-size: 13px;
    font-weight: 600;
    color: var(--color-primary-dark);
}

.auth-tooltip__list {
    margin: 0;
    padding-left: 1.1rem;
}

.auth-tooltip__list li + li {
    margin-top: 4px;
}

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

.auth-input-wrap input {
    width: 100%;
    height: 42px;
    padding: 10px 40px 10px 12px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    font: 400 15px/1.3 var(--font-family);
    color: var(--color-text);
    background: var(--color-white);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.auth-input-wrap .auth-input-icon ~ input {
    padding-left: 40px;
}

.auth-input-wrap input:focus {
    outline: none;
    border-color: var(--color-brand-blue);
    box-shadow: 0 0 0 3px rgba(179, 88, 154, 0.18);
}

.auth-input-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #9ca3af;
    display: flex;
    pointer-events: none;
}

.auth-password-toggle {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    border: 0;
    background: transparent;
    color: #9ca3af;
    cursor: pointer;
    padding: 4px;
    display: flex;
}

.auth-link,
.auth-card__footer a,
.auth-terms__text a,
.auth-page-footer a {
    color: var(--color-link);
    font-weight: 500;
    text-decoration: none;
    transition: color 0.15s ease;
}

.auth-link:hover,
.auth-card__footer a:hover,
.auth-terms__text a:hover,
.auth-page-footer a:hover {
    color: var(--color-link-hover);
    text-decoration: underline;
    text-decoration-color: var(--color-link-hover);
}

.auth-link--sm {
    font-size: 14px;
    font-weight: 500;
}

.auth-field--checkbox {
    margin: 0;
}

.auth-checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    line-height: 1.35;
    color: var(--color-text-muted);
    cursor: pointer;
}

.auth-checkbox input {
    width: 18px;
    height: 18px;
    margin: 0;
    flex-shrink: 0;
    accent-color: var(--color-brand-pink);
}

.auth-checkbox span {
    line-height: 1.35;
}

.auth-field--terms {
    margin: 0;
}

.auth-terms {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 10px;
    width: 100%;
    margin: 0;
    font-size: 14px;
    font-weight: 400;
    line-height: 1.35;
    color: var(--color-text-muted);
    cursor: pointer;
}

.auth-terms__checkbox {
    flex: 0 0 18px;
    width: 18px;
    height: 18px;
    margin: 0;
    accent-color: var(--color-brand-pink);
}

.auth-terms__text {
    flex: 1 1 auto;
    min-width: 0;
    line-height: 1.35;
}

.auth-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    border: 0;
    cursor: pointer;
    font-family: var(--font-family);
    transition: background 0.15s ease;
}

.auth-btn--primary {
    margin: 0;
    height: 44px;
    padding: 0 20px;
    border-radius: var(--radius-md);
    background: var(--color-brand-blue);
    color: #fff;
    font-size: 15px;
    font-weight: 600;
    transition: background 0.2s ease;
}

.auth-btn--primary:hover {
    background: var(--color-brand-pink);
    box-shadow: none;
}

.auth-btn--primary:focus-visible {
    outline: 2px solid var(--color-brand-pink);
    outline-offset: 2px;
}

.auth-btn--secondary {
    margin-top: 12px;
    height: 44px;
    padding: 0 20px;
    border-radius: var(--radius-md);
    background: #fff;
    color: var(--text);
    border: 1px solid var(--border, #d8dce6);
    font-size: 15px;
    font-weight: 600;
}

.auth-btn--secondary:hover {
    background: #f5f7fb;
}

.auth-card__footer-note {
    margin: 16px 0 0;
    font-size: 14px;
    line-height: 1.5;
    color: var(--text-muted);
    text-align: center;
}

.auth-form--verify-email-logout {
    margin-top: 0;
}

.auth-btn__label {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.auth-btn__label--loading {
    display: none;
}

.auth-btn__label--default {
    display: inline-flex;
}

.auth-btn.is-loading {
    pointer-events: none;
    cursor: wait;
    background: var(--color-primary-dark);
}

.auth-btn.is-loading .auth-btn__label--default {
    display: none !important;
}

.auth-btn.is-loading .auth-btn__label--loading {
    display: inline-flex !important;
}

.auth-card__title {
    margin: 0 0 8px;
    font-size: 1.35rem;
    font-weight: 600;
    color: var(--color-primary-dark);
    text-align: center;
}

.auth-card__lead {
    margin: 0 0 20px;
    font-size: 14px;
    line-height: 1.5;
    color: var(--color-text-muted);
    text-align: center;
}

.auth-otp-input {
    text-align: center;
    font-size: 1.5rem !important;
    font-weight: 700;
    letter-spacing: 0.35em;
    font-family: Consolas, 'Courier New', monospace;
}

.auth-field-hint {
    margin: 8px 0 0;
    font-size: 13px;
    color: var(--color-text-muted);
    text-align: center;
}

.auth-otp-actions {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    margin-top: 20px;
}

.auth-link--button {
    border: 0;
    background: transparent;
    padding: 0;
    cursor: pointer;
    font: inherit;
}

.auth-link--muted {
    color: var(--color-text-muted);
}

.auth-link--muted:hover {
    color: var(--color-link);
    text-decoration: underline;
    text-decoration-color: var(--color-link);
}

.auth-card__header + .auth-form,
.auth-card__header + .auth-alert + .auth-form,
.auth-alert + .auth-form {
    margin-top: 14px;
}

.auth-card__footer {
    margin: 16px 0 0;
    text-align: center;
    font-size: 14px;
    line-height: 1.35;
    color: var(--color-text-muted);
}

body.auth-page--verify-email .auth-shell--centered {
    padding: 32px 24px;
}

.auth-card--verify-email {
    padding: 40px 32px;
}

.auth-card--verify-email .auth-card__header + .auth-alert,
.auth-card--verify-email .auth-card__header + .auth-form--verify-email {
    margin-top: 24px;
}

.auth-card--verify-email .auth-alert + .auth-form--verify-email {
    margin-top: 20px;
}

.auth-card--verify-email .auth-form--verify-email {
    margin-bottom: 0;
}

.auth-page-footer {
    display: flex;
    flex-shrink: 0;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 8px 16px;
    width: 100%;
    max-width: var(--card-max);
    margin-top: 12px;
    padding: 0;
    font-size: 14px;
}

body.auth-page--register-band .auth-page-footer,
body.auth-page--register .auth-page-footer {
    max-width: 520px;
}

.auth-strength {
    padding-top: 8px;
}

.auth-strength__bars {
    display: flex;
    gap: 4px;
    height: 4px;
}

.auth-strength__bars span {
    flex: 1;
    border-radius: 9999px;
    background: #e1e2e6;
}

.auth-strength__bars span.is-weak {
    background: #dc2626;
}

.auth-strength__bars span.is-fair {
    background: var(--color-warning);
}

.auth-strength__bars span.is-good {
    background: var(--color-success);
}

.auth-page-layout--wide {
    max-width: 520px;
    --auth-card-padding-x: 32px;
    --auth-card-padding-y: 32px;
}

.auth-card--wide {
    padding: var(--auth-card-padding-y) var(--auth-card-padding-x);
}

.auth-form--band-register {
    gap: 14px;
}

.auth-form-section {
    display: flex;
    flex-direction: column;
    gap: 8px;
    border: 0;
    margin: 0;
    padding: 0;
    min-width: 0;
}

.auth-form-section legend {
    float: left;
    width: 100%;
    margin: 0 0 2px;
    padding: 0;
    font-size: 15px;
    font-weight: 600;
    line-height: 1.3;
    letter-spacing: normal;
    text-transform: none;
    color: var(--color-primary-dark);
}

.auth-form-section > :not(legend) {
    clear: both;
}

.auth-form-section__hint {
    margin: 0 0 2px;
    font-size: 13px;
    line-height: 1.4;
    color: var(--color-text-muted);
}

.auth-form-section .auth-field {
    margin: 0;
}

.auth-form-section .auth-field > label:not(.auth-terms) {
    display: block;
    font-size: 14px;
    font-weight: 600;
    margin: 0;
}

.auth-form-section .auth-field input[type="text"],
.auth-form-section .auth-field input[type="email"],
.auth-form-section .auth-field input[type="password"],
.auth-form-section .auth-field input[type="tel"] {
    width: 100%;
    height: 42px;
    padding: 10px 12px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    font: 400 15px/1.3 var(--font-family);
    color: var(--color-text);
    background: var(--color-white);
}

.auth-form-section .auth-input-wrap input {
    height: 42px;
    padding: 10px 40px 10px 12px;
    font-size: 15px;
}

.auth-field-row {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin: 0;
}

.auth-field-row .auth-field {
    flex: 1 1 140px;
    min-width: 0;
    margin: 0;
}

.auth-field-row--3 .auth-field {
    flex: 1 1 0;
    min-width: 0;
}

.auth-field-row--3 .auth-field--prefix {
    flex: 0 1 88px;
    max-width: 100px;
}

.auth-field-row--3 .auth-field--narrow {
    flex: 0 1 80px;
}

.auth-required {
    color: var(--color-brand-pink);
}

/* Language switcher — login / register (top-right) */
.auth-lang-bar {
    position: fixed;
    top: 0;
    right: 0;
    left: auto;
    z-index: 20;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    width: auto;
    max-width: none;
    margin: 0;
    padding: 20px 24px;
    pointer-events: none;
}

.auth-lang-bar .locale-switcher {
    pointer-events: auto;
    margin: 0;
}

.locale-switcher {
    display: inline-flex;
    align-items: center;
}

.locale-switcher__dropdown {
    position: relative;
}

.locale-switcher__trigger {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    min-height: 40px;
    padding: 8px 14px 8px 12px;
    border: none;
    border-radius: 8px;
    background: #e8e9ef;
    box-sizing: border-box;
    font-size: 0.875rem;
    line-height: 1.25;
    font-family: var(--font-family);
    font-weight: 400;
    color: var(--color-text);
    cursor: pointer;
}

.locale-switcher__trigger:focus,
.locale-switcher__trigger:focus-visible {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
}

.locale-switcher__icon {
    display: flex;
    flex-shrink: 0;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    color: #6b9fd4;
    line-height: 0;
}

.locale-switcher__icon svg {
    display: block;
    width: 16px;
    height: 16px;
}

.locale-switcher__label {
    min-width: 5.5rem;
    text-align: left;
}

.locale-switcher__caret {
    display: flex;
    flex-shrink: 0;
    align-items: center;
    color: var(--color-text);
    line-height: 0;
}

.locale-switcher__menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    z-index: 30;
    min-width: 100%;
    margin: 0;
    padding: 8px 0;
    list-style: none;
    background: var(--color-white);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(17, 25, 109, 0.12);
}

.locale-switcher__option-btn {
    display: block;
    width: 100%;
    margin: 0;
    padding: 12px 18px;
    border: none;
    background: transparent;
    font-size: 0.875rem;
    line-height: 1.25;
    font-family: var(--font-family);
    font-weight: 400;
    text-align: left;
    color: var(--color-text);
    cursor: pointer;
    white-space: nowrap;
}

.locale-switcher__option-btn:hover,
.locale-switcher__option.is-active .locale-switcher__option-btn {
    background: var(--color-primary);
    color: var(--color-white);
}

@media (max-width: 520px) {
    .auth-lang-bar {
        padding: 16px;
    }

    .locale-switcher__trigger {
        gap: 8px;
        min-height: 38px;
        padding: 7px 12px 7px 10px;
    }

    .locale-switcher__option-btn {
        padding: 11px 16px;
    }
}

/* Login/OTP only: fit one screen without scroll. Register stays scrollable. */
@media (min-width: 521px) and (min-height: 640px) {
    body.auth-page--login,
    body.auth-page--otp {
        overflow-y: hidden;
    }

    body.auth-page--login .auth-shell--centered,
    body.auth-page--otp .auth-shell--centered {
        min-height: 100dvh;
        max-height: 100dvh;
        overflow: hidden;
    }

    body.auth-page--register-band .auth-shell--centered,
    body.auth-page--register .auth-shell--centered {
        justify-content: flex-start;
        min-height: 100dvh;
        max-height: none;
        overflow: visible;
        padding-top: 20px;
        padding-bottom: 24px;
    }
}

@media (max-width: 520px) {
    :root {
        --auth-card-padding-x: 20px;
        --auth-card-padding-y: 24px;
        --auth-layout-gap: 16px;
    }

    body.auth-page {
        overflow-y: auto;
    }

    body.auth-page--register-band .auth-shell--centered,
    body.auth-page--register .auth-shell--centered {
        justify-content: flex-start;
    }

    .auth-shell--centered {
        min-height: 100dvh;
        max-height: none;
        overflow: visible;
        padding: 20px 16px;
    }

    .auth-page-layout {
        gap: 20px;
    }

    .auth-page-layout--wide {
        max-width: 100%;
        --auth-card-padding-x: 20px;
        --auth-card-padding-y: 24px;
    }

    body.auth-page--register-band .auth-page-footer,
    body.auth-page--register .auth-page-footer {
        max-width: 100%;
    }

    .auth-logo-full {
        width: min(var(--auth-content-width), 100%);
    }

    .auth-card {
        border-radius: 10px;
    }
}
