/* =========================================================
   AUTH FLOW
   login / register / forgot password / verify email / payment
   ========================================================= */

/* =========================================================
   AUTH MODAL
   ========================================================= */

.auth-open-button {
    appearance: none;
    -webkit-appearance: none;
}

.auth-modal {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: none;
    overflow-y: auto;
    padding: 24px 0;
}

.auth-modal.is-open {
    display: block;
}

.auth-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.72);
    backdrop-filter: blur(6px);
}

.auth-modal-dialog {
    position: relative;
    z-index: 1;
    width: min(calc(100% - 32px), 760px);
    margin: 0 auto;
    background: #414141;
    border: 1px solid var(--border);
    border-radius: 20px;
    box-shadow: var(--shadow-soft);
    padding: 24px;
    max-height: calc(100vh - 48px);
    overflow-y: auto;
}

.auth-modal-close {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 40px;
    height: 40px;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.06);
    color: var(--text);
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
}

.auth-modal-header {
    margin-bottom: 20px;
    padding-right: 44px;
}

.auth-modal-header h2 {
    margin: 0 0 8px;
    font-size: clamp(2rem, 5vw, 2.4rem);
    line-height: 1.05;
    font-weight: 400;
}

.auth-modal-header p {
    margin: 0;
    color: var(--muted);
    font-size: 15px;
    font-weight: 300;
}

.auth-modal-body {
    display: grid;
    gap: 12px;
}

/* =========================================================
   AUTH PANELS / FORMS
   ========================================================= */

.auth-panel {
    display: none;
}

.auth-panel.is-active {
    display: block;
}

.auth-form {
    display: grid;
    gap: 16px;
}

.auth-form-links {
    margin-top: -4px;
}

.auth-form-links a {
    color: var(--accent);
    font-size: 14px;
}

.auth-form-links-split {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.auth-form-actions {
    margin-top: 6px;
    display: flex;
    justify-content: flex-start;
}

.auth-form-actions .button {
    width: 100%;
}

.auth-switch-text {
    margin: 16px 0 0;
    color: var(--muted);
    font-size: 14px;
}

.auth-text-button,
.auth-text-link {
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--accent);
    cursor: pointer;
    font: inherit;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.auth-text-button:hover,
.auth-text-button:focus-visible,
.auth-text-link:hover,
.auth-text-link:focus-visible {
    opacity: 0.85;
}

.auth-helper-text {
    color: var(--muted);
    font-size: 14px;
    line-height: 1.5;
}

.auth-checkbox {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    color: var(--muted);
    font-size: 14px;
    line-height: 1.5;
}

.auth-checkbox input {
    margin-top: 3px;
}

.auth-checkbox a {
    color: var(--accent);
}

.auth-flash {
    padding: 16px 18px;
    border: 1px solid rgba(255, 245, 0, 0.22);
    border-left: 4px solid #fff500;
    border-radius: 14px;
    background: linear-gradient(180deg, rgba(255, 245, 0, 0.08), rgba(255, 245, 0, 0.03));
    color: #f5f5f5;
    font-size: 14px;
    line-height: 1.5;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.16);
    backdrop-filter: blur(8px);
}

.auth-flash.auth-flash-error {
    border-color: rgba(255, 107, 107, 0.24);
    border-left-color: #ff6b6b;
    background: linear-gradient(180deg, rgba(255, 107, 107, 0.10), rgba(255, 107, 107, 0.04));
    color: #fff4f4;
}

.auth-flash a {
    color: inherit;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.form-input.is-invalid,
.form-textarea.is-invalid {
    border-color: rgba(255, 107, 107, 0.7);
}

.form-input.is-invalid:focus,
.form-textarea.is-invalid:focus {
    border-color: rgba(255, 107, 107, 0.9);
    box-shadow: none;
}

.form-error {
    margin: 8px 0 0;
    color: #ffb3b3;
    font-size: 13px;
    line-height: 1.4;
}

/* =========================================================
   ROLE CHOICE
   ========================================================= */

.role-choice-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
}

.role-choice {
    display: grid;
    grid-template-columns: 20px 1fr;
    column-gap: 12px;
    row-gap: 4px;
    align-items: start;
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 16px;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.02);
    transition: border-color 0.2s ease, background 0.2s ease;
}

.role-choice:hover {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(255, 255, 255, 0.22);
}

.role-choice:has(input:checked) {
    background: rgba(255, 245, 0, 0.08);
    border-color: rgba(255, 245, 0, 0.45);
}

.role-choice input {
    grid-column: 1;
    grid-row: 1 / span 2;
    margin: 3px 0 0;
}

.role-choice span {
    grid-column: 2;
    display: block;
    margin: 0;
    color: var(--text);
    font-size: 18px;
    font-weight: 500;
}

.role-choice small {
    grid-column: 2;
    display: block;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.4;
}

/* =========================================================
   AUTH FLOW PAGES
   ========================================================= */

.auth-page-hero {
    padding-bottom: 24px;
}

.auth-page-section {
    padding: 0 0 56px;
}

.auth-step-label {
    display: inline-block;
    margin-bottom: 16px;
    color: var(--accent);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.auth-inline-link {
    color: var(--accent);
}

.auth-page-layout,
.payment-layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: 18px;
    align-items: start;
}

.auth-page-main-card,
.auth-page-side-card,
.payment-main-card {
    background: var(--surface-soft);
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 22px;
}

.auth-page-title {
    margin: 0 0 12px;
    font-size: clamp(1.9rem, 5vw, 2.3rem);
    line-height: 1.05;
    font-weight: 400;
}

.auth-page-text {
    margin: 0 0 16px;
    color: var(--text);
    font-size: 16px;
    font-weight: 300;
    line-height: 1.6;
}

.auth-page-text-muted {
    color: var(--muted);
}

.auth-page-actions {
    margin-top: 24px;
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

/* =========================================================
   AUTH PROGRESS
   ========================================================= */

.auth-progress-list {
    display: grid;
    gap: 10px;
}

.auth-progress-item {
    min-height: 44px;
    display: flex;
    align-items: center;
    padding: 10px 14px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.02);
    color: var(--muted);
    font-size: 14px;
}

.auth-progress-item.is-complete {
    color: #ffffff;
    border-color: rgba(255, 245, 0, 0.22);
    background: rgba(255, 245, 0, 0.06);
}

.auth-progress-item.is-active {
    color: #111111;
    background: var(--accent);
    border-color: var(--accent);
}

/* =========================================================
   VERIFY EMAIL / PAYMENT
   ========================================================= */

.payment-selected-role {
    margin-bottom: 20px;
}

.payment-selected-label {
    margin: 0 0 8px;
    color: var(--accent);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.payment-selected-role h2 {
    margin: 0 0 8px;
    font-size: clamp(2rem, 5vw, 2.4rem);
    line-height: 1.05;
    font-weight: 400;
}

.payment-selected-subtitle {
    margin: 0 0 10px;
    color: var(--muted);
    font-size: 15px;
}

.payment-change-link {
    margin: 0;
    color: var(--muted);
    font-size: 14px;
}

.payment-change-link a {
    color: var(--accent);
}

.payment-plan-card,
.payment-placeholder-card {
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 20px;
    background: rgba(255, 255, 255, 0.02);
}

.payment-plan-card {
    margin-bottom: 18px;
}

.payment-plan-header {
    display: grid;
    grid-template-columns: 1fr;
    gap: 14px;
    align-items: start;
    margin-bottom: 16px;
}

.payment-plan-header h2,
.payment-plan-header h3 {
    margin: 0 0 8px;
    font-size: clamp(1.8rem, 4vw, 2.1rem);
    line-height: 1.05;
    font-weight: 400;
}

.payment-plan-subtitle {
    margin: 0;
    color: var(--muted);
    font-size: 14px;
}

.payment-price-wrap {
    justify-self: start;
}

.payment-price {
    font-size: clamp(2.2rem, 6vw, 2.8rem);
    line-height: 1;
    color: var(--accent);
    font-weight: 400;
    white-space: nowrap;
}

.payment-price span {
    font-size: 18px;
    color: var(--text);
}

.payment-plan-summary {
    margin: 0 0 16px;
    color: var(--muted);
    font-size: 15px;
    font-weight: 300;
    line-height: 1.6;
}

.payment-feature-list {
    margin: 0;
    padding-left: 18px;
    color: var(--muted);
}

.payment-feature-list li {
    line-height: 1.7;
}

.payment-feature-list li + li {
    margin-top: 8px;
}

.payment-placeholder-card h3 {
    margin: 0 0 10px;
    font-size: 24px;
    line-height: 1.1;
    font-weight: 400;
}

.payment-placeholder-card p {
    margin: 0 0 18px;
    color: var(--muted);
    font-size: 15px;
    font-weight: 300;
    line-height: 1.6;
}

.payment-actions {
    margin-top: 20px;
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.payment-button-secondary {
    background: transparent;
    color: var(--text);
    border: 1px solid var(--border);
}

.payment-button-secondary:hover {
    background: rgba(255, 255, 255, 0.06);
}

/* =========================================================
   RESPONSIVE
   ========================================================= */

@media (min-width: 768px) {
    .auth-modal {
        padding: 48px 0;
    }

    .auth-modal-dialog {
        padding: 28px;
    }

    .auth-form-actions .button {
        width: auto;
    }

    .role-choice-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .auth-page-main-card,
    .auth-page-side-card,
    .payment-main-card {
        padding: 24px;
    }

    .payment-plan-header {
        grid-template-columns: minmax(0, 1fr) auto;
        gap: 18px;
    }

    .payment-price-wrap {
        justify-self: end;
    }

    .payment-actions {
        flex-wrap: nowrap;
    }
}

@media (min-width: 1024px) {
    .auth-page-section {
        padding-bottom: 64px;
    }

    .auth-page-layout,
    .payment-layout {
        grid-template-columns: minmax(0, 1fr) 300px;
        gap: 22px;
    }

    .auth-page-main-card,
    .auth-page-side-card,
    .payment-main-card {
        padding: 24px;
    }
}