/* ============================================================
   FOLIOSAAS — Design système
   Palette : noir profond, blanc cassé, accent or/ambre
   ============================================================ */

/* --- Reset & base --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --bg-base:       #080808;
    --bg-surface:    #111111;
    --bg-elevated:   #1a1a1a;
    --bg-border:     #2a2a2a;

    --text-primary:  #f0ede8;
    --text-secondary:#8a8780;
    --text-muted:    #4a4845;

    --accent:        #c9a96e;   /* or chaud */
    --accent-dim:    #8a6e3e;
    --accent-glow:   rgba(201,169,110,.12);

    --danger:        #c0392b;
    --success:       #27ae60;

    --radius-sm:     6px;
    --radius-md:     10px;
    --radius-lg:     16px;

    --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', monospace;

    --transition: 200ms cubic-bezier(.4,0,.2,1);
    --shadow-card: 0 1px 3px rgba(0,0,0,.5), 0 0 0 1px var(--bg-border);
}

html { font-size: 16px; scroll-behavior: smooth; }

body {
    font-family: var(--font-sans);
    background:  var(--bg-base);
    color:       var(--text-primary);
    line-height: 1.6;
    min-height:  100vh;
    -webkit-font-smoothing: antialiased;
}

/* --- Typographie --- */
h1 { font-size: clamp(1.8rem, 4vw, 2.8rem); font-weight: 300; letter-spacing: -.02em; line-height: 1.15; }
h2 { font-size: clamp(1.3rem, 2.5vw, 1.8rem); font-weight: 400; letter-spacing: -.01em; }
h3 { font-size: 1.1rem; font-weight: 500; }
p  { color: var(--text-secondary); line-height: 1.75; }
a  { color: var(--accent); text-decoration: none; transition: opacity var(--transition); }
a:hover { opacity: .75; }

/* --- Utilitaires --- */
.container   { max-width: 1140px; margin: 0 auto; padding: 0 1.5rem; }
.container-sm{ max-width: 560px;  margin: 0 auto; padding: 0 1.5rem; }
.sr-only     { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }

/* --- Boutons --- */
.btn {
    display:         inline-flex;
    align-items:     center;
    gap:             .5rem;
    padding:         .65rem 1.4rem;
    border-radius:   var(--radius-sm);
    font-size:       .9rem;
    font-weight:     500;
    cursor:          pointer;
    border:          none;
    transition:      all var(--transition);
    white-space:     nowrap;
    text-decoration: none;
}
.btn-primary {
    background: var(--accent);
    color:      #080808;
}
.btn-primary:hover {
    background: #d4b87e;
    opacity: 1;
}
.btn-ghost {
    background: transparent;
    color:      var(--text-secondary);
    border:     1px solid var(--bg-border);
}
.btn-ghost:hover {
    border-color: var(--text-muted);
    color:        var(--text-primary);
    opacity: 1;
}
.btn-danger {
    background: transparent;
    color:      var(--danger);
    border:     1px solid var(--danger);
}
.btn-sm { padding: .4rem .9rem; font-size: .82rem; }
.btn-lg { padding: .85rem 2rem; font-size: 1rem; }
.btn-full { width: 100%; justify-content: center; }

/* --- Formulaires --- */
.form-group  { display: flex; flex-direction: column; gap: .5rem; margin-bottom: 1.2rem; }
.form-label  { font-size: .85rem; color: var(--text-secondary); font-weight: 500; letter-spacing: .02em; text-transform: uppercase; }
.form-input  {
    background:    var(--bg-elevated);
    border:        1px solid var(--bg-border);
    border-radius: var(--radius-sm);
    color:         var(--text-primary);
    font-size:     .95rem;
    padding:       .7rem 1rem;
    width:         100%;
    transition:    border-color var(--transition), box-shadow var(--transition);
    outline:       none;
    font-family:   var(--font-sans);
}
.form-input:focus {
    border-color: var(--accent);
    box-shadow:   0 0 0 3px var(--accent-glow);
}
.form-input::placeholder { color: var(--text-muted); }
.form-hint { font-size: .8rem; color: var(--text-muted); }

/* --- Cards --- */
.card {
    background:    var(--bg-surface);
    border:        1px solid var(--bg-border);
    border-radius: var(--radius-lg);
    padding:       1.75rem;
    box-shadow:    var(--shadow-card);
}
.card-header {
    display:       flex;
    align-items:   center;
    justify-content: space-between;
    margin-bottom: 1.25rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--bg-border);
}
.card-title { font-size: 1rem; font-weight: 500; color: var(--text-primary); }

/* --- Alerts / Flash --- */
.alert {
    padding:       .85rem 1.1rem;
    border-radius: var(--radius-sm);
    font-size:     .9rem;
    margin-bottom: 1rem;
    border-left:   3px solid;
}
.alert-error   { background: rgba(192,57,43,.1);  border-color: var(--danger);  color: #e57e74; }
.alert-success { background: rgba(39,174,96,.1);  border-color: var(--success); color: #5dbb85; }
.alert-info    { background: var(--accent-glow);  border-color: var(--accent);  color: var(--accent); }

/* --- Badge --- */
.badge {
    display:       inline-block;
    padding:       .2rem .6rem;
    border-radius: 999px;
    font-size:     .72rem;
    font-weight:   600;
    letter-spacing: .04em;
    text-transform: uppercase;
}
.badge-active   { background: rgba(39,174,96,.15);  color: #5dbb85; }
.badge-draft    { background: rgba(138,135,128,.15); color: var(--text-secondary); }
.badge-expired  { background: rgba(192,57,43,.15);  color: #e57e74; }

/* --- Navigation publique --- */
.nav {
    display:        flex;
    align-items:    center;
    justify-content: space-between;
    padding:        1.25rem 0;
    border-bottom:  1px solid var(--bg-border);
}
.nav-logo {
    font-size:   1.1rem;
    font-weight: 600;
    color:       var(--text-primary);
    letter-spacing: -.02em;
}
.nav-logo span { color: var(--accent); }
.nav-links { display: flex; align-items: center; gap: 2rem; }
.nav-links a { color: var(--text-secondary); font-size: .9rem; }
.nav-links a:hover { color: var(--text-primary); opacity: 1; }

/* --- Hero section --- */
.hero {
    padding:    6rem 0 5rem;
    text-align: center;
}
.hero-eyebrow {
    display:        inline-block;
    font-size:      .78rem;
    letter-spacing: .12em;
    text-transform: uppercase;
    color:          var(--accent);
    margin-bottom:  1.25rem;
}
.hero h1 { margin-bottom: 1.25rem; max-width: 680px; margin-left: auto; margin-right: auto; }
.hero p   { font-size: 1.1rem; max-width: 500px; margin: 0 auto 2.5rem; }
.hero-actions { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; }

/* --- Pricing --- */
.pricing-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 1.5rem; margin-top: 3rem; }
.pricing-card {
    background:    var(--bg-surface);
    border:        1px solid var(--bg-border);
    border-radius: var(--radius-lg);
    padding:       2rem;
    transition:    border-color var(--transition), transform var(--transition);
}
.pricing-card:hover { border-color: var(--accent-dim); transform: translateY(-2px); }
.pricing-card.featured { border-color: var(--accent); }
.pricing-badge { font-size: .72rem; color: var(--accent); text-transform: uppercase; letter-spacing: .1em; font-weight: 600; margin-bottom: .75rem; }
.pricing-price { font-size: 2.5rem; font-weight: 300; color: var(--text-primary); margin: .5rem 0; }
.pricing-price span { font-size: 1rem; color: var(--text-muted); font-weight: 400; }
.pricing-features { list-style: none; margin: 1.5rem 0; display: flex; flex-direction: column; gap: .6rem; }
.pricing-features li { font-size: .9rem; color: var(--text-secondary); display: flex; align-items: center; gap: .5rem; }
.pricing-features li::before { content: '—'; color: var(--accent); font-size: .75rem; }

/* --- Dashboard sidebar --- */
.app-layout { display: flex; min-height: 100vh; }

.sidebar {
    width:      240px;
    min-width:  240px;
    background: var(--bg-surface);
    border-right: 1px solid var(--bg-border);
    display:    flex;
    flex-direction: column;
    padding:    1.5rem 0;
    position:   sticky;
    top:        0;
    height:     100vh;
}
.sidebar-logo {
    padding:       0 1.5rem 1.5rem;
    border-bottom: 1px solid var(--bg-border);
    font-size:     1rem;
    font-weight:   600;
    color:         var(--text-primary);
    letter-spacing: -.02em;
}
.sidebar-logo span { color: var(--accent); }

.sidebar-nav { flex: 1; padding: 1rem 0; }
.sidebar-nav a {
    display:       flex;
    align-items:   center;
    gap:           .75rem;
    padding:       .65rem 1.5rem;
    font-size:     .88rem;
    color:         var(--text-secondary);
    transition:    all var(--transition);
    border-left:   2px solid transparent;
    text-decoration: none;
}
.sidebar-nav a:hover  { color: var(--text-primary); background: var(--bg-elevated); opacity: 1; }
.sidebar-nav a.active { color: var(--accent); border-left-color: var(--accent); background: var(--accent-glow); }

.sidebar-footer {
    padding:    1rem 1.5rem 0;
    border-top: 1px solid var(--bg-border);
    font-size:  .8rem;
    color:      var(--text-muted);
}

/* --- Contenu principal dashboard --- */
.app-main { flex: 1; overflow-x: hidden; }
.app-topbar {
    display:         flex;
    align-items:     center;
    justify-content: space-between;
    padding:         1.1rem 2rem;
    border-bottom:   1px solid var(--bg-border);
    background:      var(--bg-surface);
    position:        sticky;
    top:             0;
    z-index:         10;
}
.app-topbar-title { font-size: .95rem; font-weight: 500; }
.app-content { padding: 2rem; }

/* --- Stats grid --- */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 1rem; margin-bottom: 2rem; }
.stat-card  {
    background:    var(--bg-surface);
    border:        1px solid var(--bg-border);
    border-radius: var(--radius-md);
    padding:       1.25rem 1.5rem;
}
.stat-label { font-size: .78rem; text-transform: uppercase; letter-spacing: .08em; color: var(--text-muted); margin-bottom: .4rem; }
.stat-value { font-size: 2rem; font-weight: 300; color: var(--text-primary); }

/* --- Table --- */
.table-wrap { overflow-x: auto; }
table  { width: 100%; border-collapse: collapse; font-size: .88rem; }
thead  { border-bottom: 1px solid var(--bg-border); }
th     { text-align: left; padding: .75rem 1rem; color: var(--text-muted); font-weight: 500; font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; }
td     { padding: .9rem 1rem; border-bottom: 1px solid var(--bg-border); color: var(--text-secondary); }
tr:last-child td { border-bottom: none; }
tr:hover td { background: var(--bg-elevated); color: var(--text-primary); }

/* --- Auth pages --- */
.auth-wrap {
    min-height:      100vh;
    display:         flex;
    align-items:     center;
    justify-content: center;
    padding:         2rem;
    background:      var(--bg-base);
}
.auth-card {
    width:         100%;
    max-width:     420px;
    background:    var(--bg-surface);
    border:        1px solid var(--bg-border);
    border-radius: var(--radius-lg);
    padding:       2.5rem;
}
.auth-logo {
    text-align:    center;
    margin-bottom: 2rem;
    font-size:     1.2rem;
    font-weight:   600;
    letter-spacing: -.02em;
}
.auth-logo span { color: var(--accent); }
.auth-title    { font-size: 1.3rem; font-weight: 400; margin-bottom: .4rem; }
.auth-subtitle { font-size: .88rem; color: var(--text-muted); margin-bottom: 2rem; }
.auth-footer   { text-align: center; margin-top: 1.5rem; font-size: .85rem; color: var(--text-muted); }

/* --- Divider --- */
.divider { border: none; border-top: 1px solid var(--bg-border); margin: 1.5rem 0; }

/* --- Empty state --- */
.empty-state { text-align: center; padding: 4rem 2rem; }
.empty-state-icon { font-size: 2.5rem; margin-bottom: 1rem; opacity: .3; }
.empty-state h3   { color: var(--text-secondary); font-weight: 400; margin-bottom: .5rem; }
.empty-state p    { font-size: .88rem; }

/* --- Responsive --- */
@media (max-width: 768px) {
    .sidebar { display: none; }
    .app-content { padding: 1.25rem; }
    .stats-grid { grid-template-columns: 1fr 1fr; }
    .nav-links { gap: 1rem; }
    .hero { padding: 3rem 0; }
}
