/* Peakfast ERP — Auth pages (login, account, 2FA) */
:root {
    --auth-bg: #f5f7fa;
    --auth-card-bg: #ffffff;
    --auth-card-border: #e2e8f0;
    --auth-text: #0f172a;
    --auth-text-muted: #64748b;
    --auth-accent: #3B8DD4;
    --auth-accent-hover: #2b7bc0;
    --auth-error-bg: #fef2f2;
    --auth-error-border: #fecaca;
    --auth-error-text: #b91c1c;
    --auth-radius: 16px;
    --auth-shadow: 0 8px 40px rgba(15, 23, 42, 0.08), 0 1px 3px rgba(15, 23, 42, 0.06);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html, body {
    height: 100%;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Inter, sans-serif;
    background: var(--auth-bg);
    color: var(--auth-text);
    -webkit-font-smoothing: antialiased;
}

/* ── Background ── */
.auth-body {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 24px;
    background: var(--auth-bg) url('worldmap.svg?v=3') no-repeat center / cover;
    position: relative;
    overflow: hidden;
}
/* Radial white overlay — fades map in center like peakfast.fr */
.auth-body::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse 55% 50% at 50% 50%, rgba(245,247,250,0.92) 40%, rgba(245,247,250,0) 100%);
    pointer-events: none;
}

/* ── Card ── */
.auth-card {
    width: 100%;
    max-width: 420px;
    background: var(--auth-card-bg);
    border: 1px solid var(--auth-card-border);
    border-radius: var(--auth-radius);
    box-shadow: var(--auth-shadow);
    padding: 40px 36px 32px;
    position: relative;
    z-index: 1;
    animation: cardIn 0.4s ease-out;
}

@keyframes cardIn {
    from { opacity: 0; transform: translateY(12px) scale(0.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

/* ── Brand ── */
.auth-brand {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    margin-bottom: 36px;
}
.auth-brand img {
    width: 48px;
    height: 48px;
    filter: drop-shadow(0 2px 8px rgba(59, 141, 212, 0.3));
}
.auth-brand-text {
    text-align: center;
    line-height: 1.2;
}
.auth-brand-name {
    font-size: 22px;
    font-weight: 800;
    color: var(--auth-text);
    letter-spacing: -0.5px;
}
.auth-brand-sub {
    font-size: 11px;
    color: var(--auth-text-muted);
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-top: 4px;
    font-weight: 500;
}

/* ── Title ── */
.auth-title {
    font-size: 22px;
    font-weight: 700;
    color: var(--auth-text);
    margin-bottom: 6px;
    letter-spacing: -0.4px;
    text-align: center;
}
.auth-subtitle {
    font-size: 14px;
    color: var(--auth-text-muted);
    margin-bottom: 28px;
    line-height: 1.6;
    text-align: center;
}

/* ── Form ── */
.auth-form {
    display: flex;
    flex-direction: column;
    gap: 18px;
}
.auth-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.auth-field label {
    font-size: 12px;
    font-weight: 600;
    color: var(--auth-text);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.auth-field input {
    padding: 13px 16px;
    border: 1.5px solid #e2e8f0;
    border-radius: 10px;
    font-size: 15px;
    color: var(--auth-text);
    background: #f8fafc;
    transition: all 0.2s ease;
    font-family: inherit;
}
.auth-field input:hover {
    border-color: #cbd5e1;
}
.auth-field input:focus {
    outline: none;
    border-color: var(--auth-accent);
    box-shadow: 0 0 0 3px rgba(59, 141, 212, 0.15);
    background: #fff;
}
.auth-field input::placeholder {
    color: #94a3b8;
}

/* ── Submit ── */
.auth-submit {
    margin-top: 4px;
    padding: 14px 16px;
    border: none;
    border-radius: 10px;
    background: var(--auth-accent);
    color: #fff;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
    position: relative;
    overflow: hidden;
}
.auth-submit:hover {
    background: var(--auth-accent-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(59, 141, 212, 0.35);
}
.auth-submit:active {
    transform: translateY(0);
    box-shadow: none;
}
.auth-submit:disabled {
    background: #94a3b8;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* ── Error banner ── */
.auth-error {
    padding: 12px 14px;
    margin-bottom: 16px;
    background: var(--auth-error-bg);
    border: 1px solid var(--auth-error-border);
    border-radius: 10px;
    color: var(--auth-error-text);
    font-size: 13px;
    line-height: 1.4;
}

/* ── Footer ── */
.auth-footer {
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid #f1f5f9;
    font-size: 13px;
    color: var(--auth-text-muted);
    text-align: center;
}
.auth-footer a {
    color: var(--auth-accent);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.15s;
}
.auth-footer a:hover { color: var(--auth-accent-hover); }

/* ── Wide card (for 2FA setup page) ── */
.auth-card-wide {
    max-width: 520px;
}

/* ── TOTP input (6 digits) ── */
.totp-input {
    text-align: center;
    font-size: 28px !important;
    font-weight: 700 !important;
    letter-spacing: 10px;
    font-family: 'SF Mono', 'Menlo', 'Monaco', 'Consolas', monospace !important;
    padding: 18px 14px !important;
    background: #fff !important;
    border: 2px solid #e2e8f0 !important;
}
.totp-input:focus {
    border-color: var(--auth-accent) !important;
    box-shadow: 0 0 0 4px rgba(59, 141, 212, 0.12) !important;
}

/* ── Setup 2FA page ── */
.setup-steps {
    margin-bottom: 24px;
}
.setup-step {
    display: flex;
    gap: 14px;
    padding: 14px 0;
    border-bottom: 1px solid #f1f5f9;
}
.setup-step:last-child { border-bottom: none; }
.setup-step-num {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--auth-accent);
    color: #fff;
    font-weight: 700;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.setup-step-text {
    font-size: 14px;
    color: var(--auth-text);
    line-height: 1.5;
}
.setup-qr {
    margin: 16px 0 8px;
    padding: 16px;
    background: #fff;
    border: 1px solid var(--auth-card-border);
    border-radius: 12px;
    text-align: center;
}
.setup-qr img {
    width: 200px;
    height: 200px;
    display: block;
    margin: 0 auto;
}
.setup-manual {
    margin-top: 10px;
    font-size: 12px;
    color: var(--auth-text-muted);
}
.setup-manual summary {
    cursor: pointer;
    user-select: none;
    padding: 4px 0;
}
.setup-manual summary:hover { color: var(--auth-accent); }
.setup-secret-box {
    margin-top: 8px;
    padding: 10px 12px;
    background: #f8fafc;
    border: 1px solid var(--auth-card-border);
    border-radius: 6px;
    word-break: break-all;
}
.setup-secret-box code {
    font-family: 'SF Mono', 'Menlo', monospace;
    font-size: 13px;
    color: var(--auth-text);
    letter-spacing: 1px;
}

/* ── Account page (Mon Compte) ── */
.account-body {
    background: #f8fafc;
    min-height: 100vh;
    padding: 32px 16px;
}
.account-wrap {
    max-width: 680px;
    margin: 0 auto;
}
.account-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 28px;
}
.account-title {
    font-size: 26px;
    font-weight: 700;
    color: var(--auth-text);
    margin-bottom: 4px;
}
.account-subtitle {
    font-size: 14px;
    color: var(--auth-text-muted);
}
.account-section {
    background: var(--auth-card-bg);
    border: 1px solid var(--auth-card-border);
    border-radius: var(--auth-radius);
    padding: 24px 28px;
    margin-bottom: 20px;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
}
.account-section-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--auth-text);
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 10px;
}
.account-section-desc {
    font-size: 13px;
    color: var(--auth-text-muted);
    line-height: 1.5;
    margin-bottom: 16px;
}
.account-field-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid #f1f5f9;
}
.account-field-row:last-child { border-bottom: none; }
.account-field-label {
    font-size: 13px;
    color: var(--auth-text-muted);
    font-weight: 500;
}
.account-field-value {
    font-size: 14px;
    color: var(--auth-text);
    font-weight: 600;
}
.account-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    background: #e0e7ff;
    color: #4338ca;
}
.account-badge-2fa {
    font-size: 10px;
}
.account-badge-ok {
    background: #dcfce7;
    color: #15803d;
}
.account-badge-warn {
    background: #fef3c7;
    color: #b45309;
}
.account-btn-danger {
    padding: 10px 18px;
    background: #fff;
    border: 1px solid var(--auth-error-border);
    color: var(--auth-error-text);
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
    font-family: inherit;
}
.account-btn-danger:hover {
    background: var(--auth-error-bg);
}
.account-btn-danger:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}
.account-btn-secondary {
    padding: 10px 18px;
    background: #fff;
    border: 1px solid var(--auth-card-border);
    color: var(--auth-text);
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
}
.account-btn-secondary:hover {
    background: #f8fafc;
}
.account-msg {
    margin-top: 12px;
    padding: 10px 12px;
    background: #fef3c7;
    border: 1px solid #fde68a;
    border-radius: 8px;
    color: #b45309;
    font-size: 13px;
}
.account-msg.account-msg-ok {
    background: #dcfce7;
    border-color: #bbf7d0;
    color: #15803d;
}
.account-footer {
    text-align: center;
    font-size: 13px;
    color: var(--auth-text-muted);
    padding: 16px 0;
}
.account-footer a {
    color: var(--auth-accent);
    text-decoration: none;
}
.account-footer a:hover { text-decoration: underline; }

/* ── Account modal (disable 2FA confirm) ── */
.account-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    z-index: 100;
}
.account-modal {
    background: #fff;
    border-radius: var(--auth-radius);
    padding: 28px 32px;
    width: 100%;
    max-width: 440px;
    box-shadow: 0 20px 60px rgba(15, 23, 42, 0.2);
}
.account-modal-title {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 8px;
}
.account-modal-desc {
    font-size: 13px;
    color: var(--auth-text-muted);
    line-height: 1.5;
    margin-bottom: 16px;
}
.account-modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 18px;
}
