/* YosemiteSync account / login — shared auth styling */

:root {
    --auth-font: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
    --auth-primary: #1b6ec2;
    --auth-primary-dark: #145a9e;
    --auth-primary-light: #e8f2fc;
    --auth-surface: #ffffff;
    --auth-text: #0f172a;
    --auth-text-muted: #64748b;
    --auth-border: #e2e8f0;
    --auth-input-bg: #f8fafc;
    --auth-radius: 14px;
    --auth-radius-sm: 10px;
    --auth-shadow: 0 24px 48px -12px rgba(15, 23, 42, 0.28);
    --auth-warning: #dc2626;
}

.auth-page {
    font-family: var(--auth-font);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ── Warning banner ── */
.authorized-warning-login {
    background: linear-gradient(90deg, #b91c1c, var(--auth-warning));
    color: #fff;
    text-align: center;
    padding: 0.55rem 1rem;
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    flex-shrink: 0;
}

.warning-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.warning-icon {
    font-size: 0.9rem;
    opacity: 0.9;
}

/* ── Background & card shell ── */
.login-container {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1.25rem;
    background-color: #0f172a;
    background-image:
        linear-gradient(135deg, rgba(15, 23, 42, 0.92) 0%, rgba(27, 110, 194, 0.55) 100%),
        url('/images/landing/hero-angus-1.jpg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    position: relative;
}

.login-card {
    width: 100%;
    max-width: 420px;
    background: var(--auth-surface);
    border-radius: var(--auth-radius);
    box-shadow: var(--auth-shadow);
    padding: 2.25rem 2rem 2rem;
    border: 1px solid rgba(255, 255, 255, 0.65);
}

.login-card-wide {
    max-width: 520px;
}

/* ── Brand header ── */
.login-brand {
    text-align: center;
    margin-bottom: 1.75rem;
}

.login-logo {
    display: block;
    margin: 0 auto 1rem;
    max-width: 180px;
    height: auto;
}

.login-title {
    font-size: 1.65rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--auth-text);
    margin: 0 0 0.25rem;
    line-height: 1.2;
}

.login-subtitle {
    font-size: 0.9rem;
    color: var(--auth-text-muted);
    margin: 0;
    font-weight: 400;
}

/* ── Alerts ── */
.auth-alert {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    padding: 0.85rem 1rem;
    border-radius: var(--auth-radius-sm);
    font-size: 0.875rem;
    line-height: 1.45;
    margin-bottom: 1.25rem;
}

.auth-alert-icon {
    flex-shrink: 0;
    width: 1.25rem;
    height: 1.25rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: 0.75rem;
    font-weight: 700;
}

.auth-alert-danger {
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.auth-alert-danger .auth-alert-icon {
    background: #fee2e2;
    color: #dc2626;
}

.auth-alert-warning {
    background: #fffbeb;
    color: #92400e;
    border: 1px solid #fde68a;
}

.auth-alert-warning .auth-alert-icon {
    background: #fef3c7;
    color: #d97706;
}

.auth-alert-success {
    background: #f0fdf4;
    color: #166534;
    border: 1px solid #bbf7d0;
}

.auth-alert-success .auth-alert-icon {
    background: #dcfce7;
    color: #16a34a;
}

/* ── Form fields ── */
.auth-form {
    display: flex;
    flex-direction: column;
    gap: 1.1rem;
}

.auth-field {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.auth-label {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--auth-text);
    letter-spacing: 0.01em;
}

.auth-input {
    width: 100%;
    height: 3rem;
    padding: 0 0.9rem;
    font-size: 0.9375rem;
    font-family: inherit;
    color: var(--auth-text);
    background: var(--auth-input-bg);
    border: 1.5px solid var(--auth-border);
    border-radius: var(--auth-radius-sm);
    transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
    box-sizing: border-box;
}

.auth-input::placeholder {
    color: #94a3b8;
}

.auth-input:hover {
    border-color: #cbd5e1;
}

.auth-input:focus {
    outline: none;
    border-color: var(--auth-primary);
    background: #fff;
    box-shadow: 0 0 0 3px rgba(27, 110, 194, 0.18);
}

/* ── Password toggle ── */
.password-field {
    position: relative;
}

.password-input-with-toggle {
    padding-right: 4.25rem;
}

.password-toggle-btn {
    position: absolute;
    right: 0.35rem;
    top: 50%;
    transform: translateY(-50%);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 2rem;
    padding: 0 0.65rem;
    border: none;
    border-radius: 6px;
    background: transparent;
    color: var(--auth-primary);
    font-size: 0.8125rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
}

.password-toggle-btn:hover,
.password-toggle-btn:focus {
    background: var(--auth-primary-light);
    color: var(--auth-primary-dark);
    outline: none;
}

/* ── Submit button ── */
.auth-submit,
.login-button {
    width: 100%;
    height: 3rem;
    margin-top: 0.35rem;
    padding: 0 1.25rem;
    font-size: 0.9375rem;
    font-weight: 600;
    font-family: inherit;
    color: #fff;
    background: linear-gradient(180deg, var(--auth-primary) 0%, var(--auth-primary-dark) 100%);
    border: none;
    border-radius: var(--auth-radius-sm);
    cursor: pointer;
    transition: transform 0.12s ease, box-shadow 0.15s ease, filter 0.15s ease;
    box-shadow: 0 4px 14px rgba(27, 110, 194, 0.35);
}

.auth-submit:hover,
.login-button:hover {
    filter: brightness(1.05);
    box-shadow: 0 6px 18px rgba(27, 110, 194, 0.42);
}

.auth-submit:active,
.login-button:active {
    transform: translateY(1px);
}

.auth-submit:focus-visible,
.login-button:focus-visible {
    outline: 2px solid var(--auth-primary);
    outline-offset: 2px;
}

/* ── Footer links ── */
.account-auth-links {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.5rem 0.75rem;
    margin-top: 1.5rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--auth-border);
    font-size: 0.875rem;
}

.account-auth-links a {
    color: var(--auth-primary);
    font-weight: 600;
    text-decoration: none;
    transition: color 0.15s ease;
}

.account-auth-links a:hover {
    color: var(--auth-primary-dark);
    text-decoration: underline;
}

.account-auth-sep {
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: #cbd5e1;
    flex-shrink: 0;
}

.password-hint {
    font-size: 0.85rem;
    color: var(--auth-text-muted);
    margin-bottom: 1rem;
}

/* ── TOTP / 2FA setup (EnableAuthenticator) ── */
.totp-mobile-tip {
    font-size: 0.9rem;
}

.totp-mobile-tip code {
    font-size: 0.85em;
    word-break: break-all;
}

.totp-setup-steps {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.totp-step-block {
    border: 1px solid var(--auth-border);
    border-radius: var(--auth-radius-sm);
    padding: 1.25rem;
    background: var(--auth-input-bg);
}

.totp-step-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
    flex-wrap: wrap;
}

.totp-step-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 4.5rem;
    padding: 0.35rem 0.65rem;
    border-radius: 999px;
    background: var(--auth-primary);
    color: #fff;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.totp-step-title {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--auth-text);
}

.totp-install-buttons {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

.totp-qr-wrap {
    display: inline-block;
    padding: 0.75rem;
    background: #fff;
    border: 1px solid var(--auth-border);
    border-radius: var(--auth-radius-sm);
    margin: 0.5rem 0 1rem;
}

.totp-qr-image {
    display: block;
    width: 200px;
    height: 200px;
}

.totp-manual-key kbd {
    font-size: 0.95rem;
    word-break: break-all;
}

.login-2fa-setup {
    margin-bottom: 1.25rem;
    padding: 1rem 1.1rem;
    border: 1px solid var(--auth-border);
    border-radius: var(--auth-radius-sm);
    background: #f8fafc;
}

.login-2fa-setup-title {
    margin: 0 0 0.35rem;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--auth-text);
}

.login-2fa-setup-help {
    margin: 0 0 0.75rem;
    font-size: 0.85rem;
    color: var(--auth-muted);
    line-height: 1.45;
}

/* ── Responsive ── */
@media (max-width: 480px) {
    .login-container {
        padding: 1.25rem 1rem;
        align-items: flex-start;
        padding-top: 2rem;
    }

    .login-card {
        padding: 1.75rem 1.35rem 1.5rem;
    }

    .login-title {
        font-size: 1.45rem;
    }

    .login-logo {
        max-width: 150px;
    }

    .totp-qr-image {
        width: 160px;
        height: 160px;
    }
}
