/*
 * Shared stylesheet for every signed-out screen (login, OTP, consent,
 * password reset, sign-up, result). Palette comes entirely from the
 * CSS custom properties emitted by templates/auth/_theme.html.twig —
 * nothing in here should hardcode a client-facing color.
 */

* {
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-primary);
    margin: 0;
}

.auth-wrapper {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 24px 16px;
}

/* Card */
.auth-card {
    background: var(--card-bg);
    width: 100%;
    max-width: 448px;
    padding: 40px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05), 0 1px 2px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(0, 0, 0, 0.05);
}

@media (max-width: 480px) {
    .auth-wrapper {
        padding: 0;
    }
    .auth-card {
        box-shadow: none;
        border: none;
        border-radius: 0;
        padding: 24px;
        min-height: 100vh;
    }
}

/* Brand header */
.brand-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 24px;
}

.brand-logo {
    width: 32px;
    height: 32px;
    display: block;
}

.brand-name {
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--text-primary);
    letter-spacing: -0.3px;
}

/* Context header */
.auth-context h1 {
    font-size: 1.5rem;
    font-weight: 400;
    margin: 0 0 8px 0;
    color: var(--text-primary);
}

.auth-context p {
    margin: 0 0 28px 0;
    font-size: 0.95rem;
    color: var(--text-secondary);
}

.app-request-name {
    font-weight: 600;
    color: var(--text-primary);
}

/* Form & floating labels */
.auth-form {
    display: flex;
    flex-direction: column;
}

.form-group {
    position: relative;
    margin-bottom: 20px;
}

.form-group input {
    width: 100%;
    padding: 16px 12px 6px 12px;
    font-size: 1rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    outline: none;
    background: transparent;
    color: var(--text-primary);
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-group label {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
    font-size: 1rem;
    pointer-events: none;
    transition: 0.2s ease all;
    background-color: transparent;
}

.form-group input:focus ~ label,
.form-group input:not(:placeholder-shown) ~ label {
    top: 10px;
    transform: translateY(0);
    font-size: 0.75rem;
    color: var(--focus-color);
    font-weight: 500;
}

.form-group input:focus {
    border-color: var(--focus-color);
    box-shadow: 0 0 0 1px var(--focus-color);
}

.form-actions {
    display: flex;
    justify-content: flex-start;
    margin-bottom: 24px;
}

.forgot-link, .options-link {
    color: var(--primary-color);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
}

.forgot-link:hover, .options-link:hover {
    text-decoration: underline;
}

/* Security / permissions notice */
.auth-notice {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    background: #f8f9fa;
    padding: 12px;
    border-radius: 6px;
    margin-bottom: 28px;
    border-left: 3px solid var(--accent-color);
}

.auth-notice .shield-icon {
    color: var(--primary-color);
    margin-top: 2px;
    flex-shrink: 0;
}

.auth-notice p {
    margin: 0;
    font-size: 0.8rem;
    color: var(--text-secondary);
    line-height: 1.4;
}

/* Error / info banners */
.auth-alert {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    background: #fdecea;
    border: 1px solid #f5c6c3;
    color: #8a2e26;
    padding: 12px 14px;
    border-radius: 6px;
    font-size: 0.85rem;
    margin-bottom: 20px;
    line-height: 1.4;
}

.auth-alert.info {
    background: #eef4fb;
    border-color: #c7dcf1;
    color: #1b4f7a;
}

/* Buttons */
.btn-group {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 10px 24px;
    border-radius: 4px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s;
}

.btn-primary:hover {
    background-color: var(--primary-hover);
}

.btn-primary:disabled {
    opacity: 0.6;
    cursor: default;
}

.btn-secondary {
    background-color: transparent;
    color: var(--primary-color);
    border: none;
    padding: 10px 12px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
}

.btn-secondary:hover {
    background-color: rgba(0, 0, 0, 0.04);
    border-radius: 4px;
}

.btn-block {
    width: 100%;
    text-align: center;
}

.card-footer {
    margin-top: 24px;
    padding-top: 16px;
    border-top: 1px solid #f0f0f0;
}

/* Global footer */
.auth-footer {
    margin-top: 24px;
    display: flex;
    gap: 16px;
    font-size: 0.75rem;
    color: var(--text-secondary);
}

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

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

@media (max-width: 480px) {
    .auth-footer {
        position: static;
        margin-bottom: 16px;
    }
}

/* One-time-code entry */
.otp-copy {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin: 0 0 24px 0;
    line-height: 1.5;
}

.otp-boxes {
    display: flex;
    gap: 8px;
    margin-bottom: 28px;
}

.otp-boxes input {
    width: 100%;
    aspect-ratio: 1;
    text-align: center;
    font-size: 1.25rem;
    font-weight: 600;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    outline: none;
    color: var(--text-primary);
    transition: border-color 0.2s, box-shadow 0.2s;
}

.otp-boxes input:focus {
    border-color: var(--focus-color);
    box-shadow: 0 0 0 1px var(--focus-color);
}

/* Result / interstitial screens */
.auth-result p {
    font-size: 0.95rem;
    color: var(--text-secondary);
    line-height: 1.5;
    margin: 0;
}
