/* ============================================================
   Pivox Cursus - Feuille de styles
   Reprend la palette Pivox : bleu nuit, violet, rose lavande
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Pacifico&family=Inter:wght@400;500;600;700&display=swap');

:root {
    --color-bg-dark: #0F274F;
    --color-bg-darker: #0A1E3F;
    --color-bg-medium: #282D6C;
    --color-violet: #8C46E6;
    --color-violet-light: #A56BF0;
    --color-violet-dark: #6A2EC9;
    --color-lavender: #E6C8FA;
    --color-lavender-light: #F5E6FF;
    --color-text-dark: #1A1A2E;
    --color-text-body: #4A4A6E;
    --color-text-muted: #6A6A8E;
    --color-bg-light: #FAFAFC;
    --color-border: #E0E0EC;
    --color-success: #27AE60;
    --color-warning: #E67E22;
    --color-error: #C0392B;

    --font-script: 'Pacifico', cursive;
    --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;

    --container-width: 1200px;
    --radius-sm: 6px;
    --radius-md: 12px;
    --shadow-sm: 0 2px 8px rgba(15, 39, 79, 0.08);
    --shadow-md: 0 8px 24px rgba(15, 39, 79, 0.12);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.6;
    color: var(--color-text-body);
    background: var(--color-white);
    -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--color-violet); text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--color-violet-dark); }

.container { max-width: var(--container-width); margin: 0 auto; padding: 0 24px; }

/* ===== HEADER ===== */
.site-header {
    background: var(--color-bg-dark);
    padding: 16px 0;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.15);
}
.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 32px;
}
.site-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
}
.site-logo .logo-script {
    font-family: var(--font-script);
    font-size: 32px;
    color: var(--color-lavender);
    line-height: 1;
}
.site-logo .logo-suffix {
    color: var(--color-violet);
    font-weight: 700;
    padding: 4px 10px;
    background: rgba(140, 70, 230, 0.2);
    border-radius: 4px;
    font-size: 14px;
    letter-spacing: 1px;
    text-transform: uppercase;
}
.site-nav ul {
    display: flex;
    align-items: center;
    gap: 8px;
    list-style: none;
}
.site-nav a {
    color: var(--color-lavender);
    padding: 10px 16px;
    border-radius: var(--radius-sm);
    font-weight: 500;
    font-size: 15px;
    transition: all 0.2s;
}
.site-nav a:hover { background: rgba(140, 70, 230, 0.2); color: white; }
.site-nav a.btn-cta-header {
    background: var(--color-violet);
    color: white;
    padding: 10px 20px;
}
.site-nav a.btn-cta-header:hover { background: var(--color-violet-light); }

/* ===== HERO ===== */
.hero {
    background: linear-gradient(135deg, var(--color-bg-dark) 0%, var(--color-bg-medium) 100%);
    color: white;
    padding: 100px 0 80px;
    text-align: center;
    position: relative;
    overflow: hidden;
}
.hero::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(140, 70, 230, 0.3) 0%, transparent 70%);
    border-radius: 50%;
}
.hero-content {
    position: relative;
    z-index: 1;
    max-width: 800px;
    margin: 0 auto;
}
.hero h1 {
    color: white;
    font-size: clamp(2rem, 5vw, 3.25rem);
    margin-bottom: 24px;
    letter-spacing: -0.02em;
    line-height: 1.15;
}
.hero-subtitle {
    font-size: 1.25rem;
    color: var(--color-lavender);
    margin-bottom: 40px;
}
.hero-actions { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; }
.hero-trial-banner {
    display: inline-block;
    background: rgba(140, 70, 230, 0.3);
    color: white;
    padding: 8px 20px;
    border-radius: 20px;
    font-weight: 600;
    margin-bottom: 24px;
}

/* ===== BOUTONS ===== */
.btn {
    display: inline-block;
    padding: 14px 32px;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
    text-align: center;
    line-height: 1.4;
    font-family: var(--font-body);
}
.btn-primary { background: var(--color-violet); color: white; }
.btn-primary:hover { background: var(--color-violet-light); color: white; transform: translateY(-2px); box-shadow: 0 8px 20px rgba(140, 70, 230, 0.4); }
.btn-secondary { background: transparent; color: var(--color-lavender); border: 2px solid var(--color-lavender); }
.btn-secondary:hover { background: var(--color-lavender); color: var(--color-bg-dark); }
.btn-light { background: white; color: var(--color-bg-dark); border: 2px solid var(--color-border); }
.btn-light:hover { background: var(--color-bg-light); color: var(--color-violet-dark); border-color: var(--color-violet); }
.btn-sm { padding: 8px 16px; font-size: 14px; }
.btn-block { width: 100%; }

/* ===== SECTIONS ===== */
section { padding: 80px 0; }
.section-light { background: var(--color-bg-light); }
.section-dark { background: var(--color-bg-dark); color: white; }
.section-dark h2, .section-dark h3 { color: white; }

h1, h2, h3, h4 {
    color: var(--color-text-dark);
    line-height: 1.2;
    font-weight: 700;
    margin-bottom: 0.5em;
}
h2 { font-size: clamp(1.75rem, 3.5vw, 2.5rem); margin-bottom: 24px; }
h3 { font-size: 1.4rem; margin-bottom: 16px; }
p { margin-bottom: 16px; }
p:last-child { margin-bottom: 0; }

.content-section { padding: 60px 0; }
.content-narrow { max-width: 800px; margin: 0 auto; }

/* ===== CARTES ===== */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 24px;
    margin-top: 32px;
}
.card {
    background: white;
    border-radius: var(--radius-md);
    padding: 32px 28px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--color-border);
    transition: all 0.3s;
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); border-color: var(--color-violet); }
.card h3 { color: var(--color-violet-dark); }

/* ===== FORMULAIRES ===== */
.form-container {
    max-width: 600px;
    margin: 0 auto;
    background: white;
    padding: 40px;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
}
.form-container.form-large { max-width: 800px; }

.form-group { margin-bottom: 20px; }
.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--color-text-dark);
    font-size: 15px;
}
.form-group .required { color: var(--color-violet); }
.form-group small {
    display: block;
    margin-top: 6px;
    color: var(--color-text-muted);
    font-size: 13px;
}

.form-control {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--color-border);
    border-radius: var(--radius-sm);
    font-size: 16px;
    font-family: var(--font-body);
    transition: border-color 0.2s;
    background: white;
}
.form-control:focus { outline: none; border-color: var(--color-violet); }
textarea.form-control { min-height: 120px; resize: vertical; }
select.form-control { cursor: pointer; }

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}
@media (max-width: 600px) { .form-row { grid-template-columns: 1fr; } }

.form-checkbox {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 14px;
    line-height: 1.5;
    cursor: pointer;
}
.form-checkbox input { margin-top: 4px; flex-shrink: 0; }

.form-radio-group {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}
.form-radio {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

/* Messages */
.form-error, .alert-error {
    background: #FEE; border-left: 4px solid #C44; padding: 14px 18px;
    border-radius: var(--radius-sm); margin-bottom: 20px; color: #722;
}
.form-success, .alert-success {
    background: #EFE; border-left: 4px solid #4A4; padding: 14px 18px;
    border-radius: var(--radius-sm); margin-bottom: 20px; color: #272;
}
.alert-info {
    background: #E5F2FF; border-left: 4px solid #3498DB; padding: 14px 18px;
    border-radius: var(--radius-sm); margin-bottom: 20px; color: #1A4F7A;
}
.alert-warning {
    background: #FFF4E5; border-left: 4px solid #E67E22; padding: 14px 18px;
    border-radius: var(--radius-sm); margin-bottom: 20px; color: #7A4112;
}

/* ===== AUTH (login/inscription) ===== */
.auth-page {
    min-height: 100vh;
    background: linear-gradient(135deg, #0F274F 0%, #282D6C 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}
.auth-container { width: 100%; max-width: 480px; }
.auth-card {
    background: white;
    padding: 40px;
    border-radius: var(--radius-md);
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.3);
}
.auth-logo { text-align: center; margin-bottom: 24px; }
.auth-logo .logo-script {
    font-family: var(--font-script);
    font-size: 48px;
    color: var(--color-violet);
}
.auth-logo .logo-suffix {
    color: var(--color-violet-dark);
    font-weight: 700;
    margin-left: 4px;
    letter-spacing: 1px;
    text-transform: uppercase;
    font-size: 14px;
    background: var(--color-lavender-light);
    padding: 4px 10px;
    border-radius: 4px;
}
.auth-card h1 { text-align: center; margin-bottom: 8px; font-size: 1.5rem; }
.auth-card .auth-subtitle { text-align: center; color: var(--color-text-muted); margin-bottom: 24px; }
.auth-footer { text-align: center; margin-top: 24px; padding-top: 24px; border-top: 1px solid var(--color-border); }

/* ===== APP (espace connecté admin/client) ===== */
.app-body { background: #F4F5FA; min-height: 100vh; }

.app-header {
    background: var(--color-bg-dark);
    color: white;
    padding: 12px 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    position: sticky;
    top: 0;
    z-index: 100;
}
.app-header-inner {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

.app-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    color: white;
    text-decoration: none;
}
.app-logo .logo-script {
    font-family: var(--font-script);
    font-size: 26px;
    color: var(--color-lavender);
    line-height: 1;
}
.app-badge {
    background: var(--color-violet);
    color: white;
    padding: 3px 9px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}
.app-badge-admin { background: var(--color-error); }

.app-nav {
    display: flex;
    align-items: center;
    gap: 4px;
}
.app-nav a {
    color: var(--color-lavender);
    padding: 8px 14px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s;
}
.app-nav a:hover, .app-nav a.active {
    background: rgba(140, 70, 230, 0.3);
    color: white;
}

.app-user {
    display: flex;
    align-items: center;
    gap: 12px;
    padding-left: 16px;
    border-left: 1px solid rgba(255, 255, 255, 0.2);
}
.app-user-name { color: var(--color-lavender); font-size: 14px; }
.app-logout {
    background: rgba(255, 255, 255, 0.1) !important;
    color: white !important;
}
.app-logout:hover { background: var(--color-violet) !important; }

.app-main { padding: 32px 0; }
.app-container { max-width: 1400px; margin: 0 auto; padding: 0 24px; }

.app-card {
    background: white;
    border-radius: 8px;
    padding: 24px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    margin-bottom: 24px;
}
.app-card h2 {
    margin-top: 0;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--color-violet);
    display: inline-block;
    font-size: 1.3rem;
}

.app-card-section {
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid var(--color-border);
}
.app-card-section:first-child { margin-top: 0; padding-top: 0; border-top: none; }
.app-card-section h3 { margin-top: 0; color: var(--color-violet-dark); }

/* Stats */
.app-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 16px;
    margin-bottom: 32px;
}
.app-stat {
    background: white;
    padding: 24px;
    border-radius: 8px;
    text-align: center;
    text-decoration: none;
    color: inherit;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    border: 2px solid transparent;
    transition: all 0.2s;
}
.app-stat:hover { transform: translateY(-2px); color: inherit; }
.app-stat.active { border-color: var(--color-violet); }
.app-stat-num {
    display: block;
    font-size: 2.2rem;
    font-weight: 700;
    color: var(--color-violet);
    line-height: 1;
}
.app-stat-label {
    display: block;
    margin-top: 8px;
    color: var(--color-text-muted);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Tableaux */
.app-table {
    width: 100%;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    border-collapse: collapse;
}
.app-table th {
    background: var(--color-bg-dark);
    color: white;
    padding: 14px 16px;
    text-align: left;
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.app-table td {
    padding: 14px 16px;
    border-bottom: 1px solid var(--color-border);
}
.app-table tr:last-child td { border-bottom: none; }
.app-table tr:hover { background: #FAFAFC; }
.app-table small { color: var(--color-text-muted); }

/* Badges statut */
.badge-status {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.status-trial { background: #FFF4E5; color: #E67E22; }
.status-active { background: #E5F8EC; color: #27AE60; }
.status-expired { background: #FAE5E5; color: #C0392B; }
.status-cancelled { background: #F0F0F0; color: #6A6A8E; }

/* Bandeau essai */
.trial-banner {
    background: linear-gradient(135deg, #E67E22 0%, #D35400 100%);
    color: white;
    padding: 12px 24px;
    text-align: center;
    font-weight: 500;
}
.trial-banner.expired {
    background: linear-gradient(135deg, #C0392B 0%, #962B21 100%);
}
.trial-banner a { color: white; text-decoration: underline; font-weight: 700; }

/* Footer */
.site-footer {
    background: var(--color-bg-darker);
    color: var(--color-lavender);
    padding: 40px 0 20px;
    margin-top: 80px;
}
.site-footer .container {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 20px;
}
.site-footer p { color: var(--color-text-muted); font-size: 14px; }
.site-footer a { color: var(--color-lavender); }

/* Responsive */
@media (max-width: 900px) {
    .app-header-inner { flex-wrap: wrap; }
    .app-nav { order: 3; width: 100%; flex-wrap: wrap; }
}
@media (max-width: 640px) {
    section { padding: 56px 0; }
    .hero { padding: 60px 0 56px; }
    .hero-actions { flex-direction: column; align-items: stretch; }
    .form-container { padding: 24px; }
    .auth-card { padding: 28px 20px; }
}
