:root {
    --fx-primary: #2952e3;
    --fx-primary-dark: #1e3fbf;
    --fx-primary-soft: #eaefff;
    --fx-accent: #f5a623;
    --fx-accent-dark: #d98c0f;
    --fx-ink: #1a1d29;
    --fx-ink-soft: #565b73;
    --fx-bg-soft: #f7f8fc;
    --fx-line: #e6e8f0;
    --fx-success: #1e8e5a;
    --fx-radius: 14px;
}

/*
 * Classes utilitaires remplaçant des styles inline : la CSP du site
 * (default-src 'self', sans style-src explicite) bloque tout attribut
 * style="..." — voir FacturX\Security::sendSecurityHeaders(). Toujours
 * passer par une classe CSS, jamais par un style inline.
 */
.fx-form-wide { max-width: 720px; }
.fx-card-narrow { max-width: 320px; }
.fx-auth-wrap { display: flex; justify-content: center; }
.fx-auth-card { max-width: 440px; width: 100%; margin: 2rem 0; }

/* Checklist des règles de mot de passe (inscription) */
.fx-password-rules { list-style: none; padding: 0; margin: .6rem 0 0; font-size: .85rem; }
.fx-password-rules li { display: flex; align-items: center; gap: .45rem; color: var(--fx-ink-soft); padding: .1rem 0; }
.fx-password-rules li.fx-rule-ok { color: var(--fx-success); }
.fx-password-rules .fx-rule-icon { font-size: 1rem; }

body {
    font-family: 'Poppins', system-ui, -apple-system, sans-serif;
    color: var(--fx-ink);
    background: var(--fx-bg-soft);
}

h1, h2, h3, h4, .navbar-brand {
    font-weight: 600;
}

a { color: var(--fx-primary); }

main.fx-main {
    max-width: 960px;
    margin: 0 auto;
    padding: 2rem 1rem 4rem;
}

/* Navbar */
.fx-navbar {
    background: #fff;
    border-bottom: 1px solid var(--fx-line);
}
.fx-navbar .navbar-brand {
    color: var(--fx-ink);
    font-size: 1.3rem;
}
.fx-navbar .navbar-brand .fx-dot { color: var(--fx-accent); }
.fx-navbar .nav-link {
    color: var(--fx-ink-soft);
    font-weight: 500;
}
.fx-navbar .nav-link:hover,
.fx-navbar .nav-link.active { color: var(--fx-primary); }

/* Buttons */
.btn-primary, button[type="submit"]:not(.btn) {
    background-color: var(--fx-primary);
    border-color: var(--fx-primary);
    color: #fff;
}
button[type="submit"]:not(.btn) {
    border: 1px solid var(--fx-primary);
    border-radius: 8px;
    padding: .55rem 1.1rem;
    font-weight: 500;
    cursor: pointer;
}
button[type="submit"]:not(.btn):hover { background-color: var(--fx-primary-dark); border-color: var(--fx-primary-dark); }

button.secondary, .btn-outline-primary {
    background: #fff;
    color: var(--fx-primary);
    border: 1px solid var(--fx-line);
    border-radius: 8px;
    padding: .55rem 1.1rem;
    font-weight: 500;
    cursor: pointer;
}
button.secondary:hover { border-color: var(--fx-primary); }

button.link {
    border: none;
    background: none;
    color: #d64545;
    text-decoration: underline;
    padding: 0;
    cursor: pointer;
}

/* Forms */
form.stack { display: flex; flex-direction: column; gap: 1rem; max-width: 440px; }
label { font-weight: 600; font-size: .92rem; }
input, select, textarea {
    padding: .6rem .75rem;
    font-size: 1rem;
    border: 1px solid var(--fx-line);
    border-radius: 8px;
    font-family: inherit;
}
input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--fx-primary);
    box-shadow: 0 0 0 3px var(--fx-primary-soft);
}

.flash-error { color: #b00020; background: #fdeaea; border: 1px solid #f3c2c2; border-radius: var(--fx-radius); padding: .8rem 1.1rem; margin-bottom: 1.25rem; }
.flash-success { color: #1e6b1e; background: #eaf7ea; border: 1px solid #c2e6c2; border-radius: var(--fx-radius); padding: .8rem 1.1rem; margin-bottom: 1.25rem; }

/* Cards */
.card {
    background: #fff;
    border: 1px solid var(--fx-line);
    border-radius: var(--fx-radius);
    padding: 1.5rem;
    margin-bottom: 1.25rem;
    box-shadow: 0 1px 3px rgba(26, 29, 41, .04);
}

/* Tables */
table { width: 100%; border-collapse: collapse; margin-bottom: 1.25rem; background: #fff; border-radius: var(--fx-radius); overflow: hidden; }
th, td { text-align: left; padding: .75rem; border-bottom: 1px solid var(--fx-line); }
th { color: var(--fx-ink-soft); font-size: .85rem; text-transform: uppercase; letter-spacing: .03em; }

/* Badges */
.badge { display: inline-block; padding: .25rem .65rem; border-radius: 999px; font-size: .8rem; font-weight: 500; }
.badge-brouillon { background: #eee; color: #555; }
.badge-emise { background: var(--fx-primary-soft); color: var(--fx-primary-dark); }
.badge-encaissee { background: #dcfce7; color: #166534; }
.badge-annulee { background: #fee2e2; color: #991b1b; }

/* Pricing (subscription page) */
.plans { display: flex; gap: 1.25rem; flex-wrap: wrap; }
.plan-card { background: #fff; border: 1px solid var(--fx-line); border-radius: var(--fx-radius); padding: 1.5rem; flex: 1; min-width: 200px; }
.plan-card.active { border-color: var(--fx-primary); border-width: 2px; }

/* Invoice line editor */
.line-row { display: grid; grid-template-columns: 3fr 1fr 1fr 1fr auto; gap: .6rem; align-items: center; margin-bottom: .6rem; }

.muted { color: var(--fx-ink-soft); font-size: .9rem; }

/* Footer */
.fx-app-footer {
    background: #fff;
    border-top: 1px solid var(--fx-line);
    padding: 1.5rem 0;
    margin-top: 3rem;
    text-align: center;
    font-size: .85rem;
    color: var(--fx-ink-soft);
}
.fx-app-footer a { color: var(--fx-ink-soft); text-decoration: none; }
.fx-app-footer a:hover { color: var(--fx-primary); text-decoration: underline; }

@media (max-width: 575.98px) {
    .line-row { grid-template-columns: 1fr; }
}
