/* Auth — McKinsey light modal + profile setup */

/* Modal overlay — hidden by default, shown via JS toggle */
.auth-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(4px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: var(--z-modal);
    padding: 20px;
}

.auth-overlay--visible {
    display: flex;
}

/* Close button in modal card */
.auth-modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    color: var(--warm-gray);
    font-size: 24px;
    cursor: pointer;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color var(--duration-fast) var(--ease-smooth),
                background var(--duration-fast) var(--ease-smooth);
}

.auth-modal-close:hover {
    color: var(--charcoal);
    background: var(--pearl);
}

/* Auth container — centers card on standalone page */
.auth-container {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    min-height: calc(100vh - var(--nav-h));
}

.auth-card {
    position: relative;
    width: 100%;
    max-width: 440px;
    background: var(--white);
    border: 1px solid var(--cloud);
    border-radius: var(--radius-xl);
    padding: 48px 32px;
    box-shadow: var(--shadow-modal);
}

@media (max-width: 480px) {
    .auth-card {
        padding: 40px 24px;
    }
}

.auth-logo {
    text-align: center;
    margin-bottom: 32px;
}

.auth-logo-icon {
    margin-bottom: 16px;
}

.auth-logo-icon svg {
    stroke: var(--navy);
}

.auth-title {
    font-family: var(--font-display);
    font-size: var(--text-2xl);
    font-weight: var(--font-weight-bold);
    color: var(--navy);
    text-align: center;
    margin-bottom: 12px;
}

.auth-subtitle {
    font-size: var(--text-base);
    color: var(--slate);
    text-align: center;
    margin-bottom: 32px;
    line-height: 1.5;
}

.error-notice {
    background: var(--coral-light);
    border: 1px solid var(--coral);
    border-radius: var(--radius-md);
    padding: 16px;
    margin-bottom: 24px;
}

.error-notice p {
    font-size: var(--text-sm);
    color: var(--coral);
    margin: 0;
    text-align: center;
    line-height: 1.5;
}

.oauth-section {
    margin-top: var(--space-4);
}

.oauth-intro {
    font-size: var(--text-sm);
    color: var(--slate);
    text-align: center;
    margin-bottom: var(--space-4);
}

.oauth-buttons {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 24px;
}

.btn-oauth {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 14px 24px;
    background: var(--white);
    border: 1px solid var(--cloud);
    border-radius: var(--radius-md);
    color: var(--charcoal);
    text-decoration: none;
    font-weight: var(--font-weight-semibold);
    font-size: var(--text-base);
    transition: all var(--duration-fast) var(--ease-smooth);
    cursor: pointer;
}

.btn-oauth:hover {
    border-color: var(--color-google);
    box-shadow: var(--shadow-md);
    transform: var(--hover-lift-sm);
    color: var(--charcoal);
    text-decoration: none;
}

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

.auth-footer {
    font-size: var(--text-sm);
    color: var(--warm-gray);
    text-align: center;
    line-height: 1.5;
}

.auth-footer a {
    color: var(--navy-light);
    text-decoration: none;
}

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

.invite-notice {
    background: var(--pearl);
    border: 1px solid var(--cloud);
    border-radius: var(--radius-md);
    padding: 16px;
    margin-bottom: 24px;
}

.invite-notice p {
    font-size: var(--text-sm);
    color: var(--slate);
    margin: 0;
    text-align: center;
}

/* Error modal */
.error-modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: var(--z-modal);
    padding: 20px;
}

.error-modal-content {
    background: var(--white);
    border: 1px solid var(--cloud);
    border-radius: var(--radius-lg);
    padding: 32px;
    max-width: 500px;
    width: 100%;
    box-shadow: var(--shadow-modal);
}

.error-modal h2 {
    font-family: var(--font-display);
    font-size: var(--text-xl);
    font-weight: var(--font-weight-bold);
    color: var(--navy);
    margin-bottom: 16px;
}

.error-modal p {
    font-size: var(--text-base);
    color: var(--slate);
    line-height: 1.6;
    margin-bottom: 24px;
}

.error-modal code {
    display: block;
    background: var(--pearl);
    border: 1px solid var(--cloud);
    border-radius: var(--radius-sm);
    padding: 12px;
    font-family: var(--font-mono);
    font-size: var(--text-sm);
    color: var(--coral);
    margin-bottom: 24px;
    word-break: break-all;
}

.error-modal button {
    width: 100%;
    padding: 14px;
    background: var(--navy);
    color: var(--white);
    border: none;
    border-radius: var(--radius-md);
    font-weight: var(--font-weight-semibold);
    font-size: var(--text-base);
    cursor: pointer;
    transition: background var(--duration-fast) var(--ease-smooth),
                transform var(--duration-fast) var(--ease-smooth);
}

.error-modal button:hover {
    background: var(--navy-light);
    transform: var(--hover-lift-sm);
}

/* Profile Setup */
.profile-setup {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-4);
}

.profile-setup__card {
    width: 100%;
    max-width: 400px;
    background: var(--white);
    border: 1px solid var(--cloud);
    border-radius: var(--radius-xl);
    padding: 40px 32px;
    box-shadow: var(--shadow-modal);
}

@media (max-width: 480px) {
    .profile-setup__card {
        padding: 32px 24px;
    }
}

.profile-setup__title {
    font-family: var(--font-display);
    font-size: var(--text-2xl);
    font-weight: var(--font-weight-bold);
    color: var(--navy);
    margin-bottom: 32px;
    text-align: center;
}

@media (max-width: 480px) {
    .profile-setup__title {
        font-size: var(--text-xl);
        margin-bottom: 24px;
    }
}

.profile-setup__error {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    background: var(--coral-light);
    border: 1px solid var(--coral);
    border-radius: var(--radius-md);
    color: var(--coral);
    font-size: var(--text-sm);
    margin-bottom: 20px;
}

.profile-setup__error svg {
    flex-shrink: 0;
    color: var(--coral);
}

.profile-setup__form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.profile-setup__input {
    width: 100%;
    padding: 14px 18px;
    background: var(--white);
    border: 1px solid var(--cloud);
    border-radius: var(--radius-md);
    color: var(--charcoal);
    font-size: var(--text-base);
    font-family: var(--font-body);
    transition: border-color var(--duration-fast) var(--ease-smooth),
                box-shadow var(--duration-fast) var(--ease-smooth);
    outline: none;
}

.profile-setup__input:focus {
    border-color: var(--navy-light);
    box-shadow: 0 0 0 3px rgba(0, 58, 112, 0.08);
}

.profile-setup__input::placeholder {
    color: var(--silver);
}

.profile-setup__status {
    min-height: 20px;
    font-size: var(--text-sm);
    margin-top: -8px;
}

.profile-setup__preview {
    font-size: var(--text-sm);
    color: var(--warm-gray);
    margin-top: -8px;
    text-align: center;
}

.profile-setup__preview span {
    color: var(--navy-light);
    font-weight: var(--font-weight-semibold);
}

.profile-setup__btn {
    width: 100%;
    padding: 14px 24px;
    background: var(--navy);
    border: none;
    border-radius: var(--radius-md);
    color: var(--white);
    font-size: var(--text-base);
    font-weight: var(--font-weight-semibold);
    font-family: var(--font-body);
    cursor: pointer;
    transition: background var(--duration-fast) var(--ease-smooth),
                transform var(--duration-fast) var(--ease-smooth);
    margin-top: 8px;
    box-shadow: var(--shadow-md);
}

.profile-setup__btn:hover {
    background: var(--navy-light);
    transform: var(--hover-lift-sm);
}

.profile-setup__btn:active {
    transform: translateY(0);
}

/* HTMX Status Messages */
.username-hint {
    color: var(--slate);
    font-size: var(--text-sm);
}

.username-available {
    color: var(--sage);
    font-size: var(--text-sm);
    font-weight: var(--font-weight-medium);
}

.username-error {
    color: var(--coral);
    font-size: var(--text-sm);
    font-weight: var(--font-weight-medium);
}

/* Inline style extractions */
.input-lowercase {
    text-transform: lowercase;
}

.input-uppercase {
    text-transform: uppercase;
}

.oauth-btn-label {
    font-size: var(--text-sm);
}

.oauth-footer-link {
    color: var(--navy-light);
    text-decoration: none;
}