:root {
    --bg:      #0a0a0f;
    --card:    #12121a;
    --border:  #1e1e2e;
    --accent:  #7c3aed;
    --cyan:    #06b6d4;
    --text:    #e2e8f0;
    --muted:   #94a3b8;
    --radius:  12px;
}

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

body {
    font-family: 'Segoe UI', system-ui, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
}

a { color: inherit; text-decoration: none; }

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 2rem 1.2rem;
}

/* ── HEADER ── */
header { text-align: center; margin-bottom: 2.5rem; }

.logo {
    font-size: 0.85rem;
    letter-spacing: .15em;
    color: var(--muted);
    text-transform: uppercase;
    margin-bottom: 1rem;
}
.logo a { color: var(--muted); }

header h1 {
    font-size: clamp(1.8rem, 5vw, 2.8rem);
    font-weight: 700;
    margin-bottom: .6rem;
    line-height: 1.2;
}

.accent { color: var(--accent); }

header p { color: var(--muted); font-size: 1.05rem; }

/* ── STATS GRID ── */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: .8rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.2rem;
    text-align: center;
    transition: box-shadow .2s;
}
.stat-card:hover { box-shadow: 0 0 18px rgba(124,58,237,.18); }
.stat-card.highlight { border-color: var(--cyan); }
.stat-card.highlight .stat-num { color: var(--cyan); }

.stat-num {
    font-size: 2rem;
    font-weight: 700;
    color: var(--accent);
    line-height: 1.1;
}
.stat-label { font-size: .8rem; color: var(--muted); margin-top: .3rem; }

/* ── FORM ── */
form {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 2rem;
    margin-bottom: 2rem;
}

.form-row { margin-bottom: 1.2rem; }
.form-row.four {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    font-size: .85rem;
    color: var(--muted);
    margin-bottom: .4rem;
}
.muted { opacity: .6; }

.form-group input {
    width: 100%;
    padding: .7rem 1rem;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--bg);
    color: var(--text);
    font-size: 1rem;
    outline: none;
    transition: border-color .2s;
}
.form-group input:focus { border-color: var(--accent); }
.form-group input::placeholder { color: var(--muted); opacity: .5; }

/* ── BUTTONS ── */
.btn-main {
    display: inline-block;
    background: var(--accent);
    color: #fff;
    padding: .8rem 2rem;
    border-radius: 8px;
    font-weight: 600;
    font-size: 1rem;
    border: none;
    cursor: pointer;
    transition: background .2s, transform .15s, box-shadow .2s;
    width: 100%;
    text-align: center;
}
.btn-main:hover {
    background: #6d28d9;
    transform: translateY(-2px);
    box-shadow: 0 0 24px rgba(124,58,237,.35);
}

.btn-share {
    background: transparent;
    color: var(--cyan);
    border: 1px solid var(--cyan);
    padding: .5rem 1.2rem;
    border-radius: 8px;
    cursor: pointer;
    font-size: .9rem;
    transition: background .2s;
}
.btn-share:hover { background: rgba(6,182,212,.1); }

/* ── LOADER ── */
.hidden { display: none !important; }

#loading {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 3rem 0;
}

.loader-box {
    text-align: center;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 2.5rem 3rem;
    min-width: 300px;
}

.spinner {
    width: 48px; height: 48px;
    border: 3px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin .8s linear infinite;
    margin: 0 auto 1.2rem;
}
@keyframes spin { to { transform: rotate(360deg); } }

#loading-msg {
    color: var(--muted);
    font-size: .95rem;
    margin-bottom: 1.2rem;
    min-height: 1.4rem;
}

.loader-steps {
    display: flex;
    gap: .5rem;
    justify-content: center;
    flex-wrap: wrap;
}
.step {
    font-size: .75rem;
    padding: .2rem .6rem;
    border-radius: 20px;
    border: 1px solid var(--border);
    color: var(--muted);
    transition: all .3s;
}
.step.active { border-color: var(--accent); color: var(--accent); }
.step.done   { background: var(--accent); color: #fff; border-color: var(--accent); }

/* ── PROFILE HERO ── */
.profile-hero {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.8rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.profile-img {
    width: 100px; height: 100px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--accent);
    flex-shrink: 0;
}

.profile-info h1 { font-size: 1.6rem; margin-bottom: .3rem; }
.bio { color: var(--muted); font-size: .9rem; margin-bottom: .5rem; }
.date-badge {
    font-size: .75rem;
    color: var(--muted);
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: .2rem .7rem;
    display: inline-block;
}

/* ── ANALYSES ── */
.analyses-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.2rem;
    flex-wrap: wrap;
    gap: .8rem;
}
.analyses-header h2 { font-size: 1.1rem; color: var(--muted); font-weight: 400; }

.analyses-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.analyse-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.4rem;
    animation: fadeUp .4s ease both;
    transition: box-shadow .2s, border-color .2s;
}
.analyse-card:hover {
    box-shadow: 0 0 20px rgba(124,58,237,.2);
    border-color: rgba(124,58,237,.4);
}

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

.analyse-card h3 {
    font-size: 1rem;
    color: var(--cyan);
    margin-bottom: .7rem;
    line-height: 1.3;
}
.analyse-card p {
    font-size: .88rem;
    color: var(--muted);
    line-height: 1.65;
}

/* ── CTA BAR ── */
.cta-bar {
    display: flex;
    justify-content: center;
    margin: 1.5rem 0 2.5rem;
}
.cta-bar .btn-main { width: auto; padding: .8rem 2.5rem; }

/* ── RECENT ── */
.recent-section { margin-top: 2rem; }
.recent-section h3 { font-size: .9rem; color: var(--muted); margin-bottom: 1rem; }

.recent-list {
    display: flex;
    gap: .8rem;
    flex-wrap: wrap;
}

.recent-item {
    display: flex;
    align-items: center;
    gap: .5rem;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: .4rem .9rem .4rem .5rem;
    font-size: .82rem;
    color: var(--muted);
    transition: border-color .2s, color .2s;
}
.recent-item:hover { border-color: var(--accent); color: var(--text); }
.recent-item img {
    width: 26px; height: 26px;
    border-radius: 50%;
    object-fit: cover;
}

/* ── RESPONSIVE ── */
@media (max-width: 600px) {
    .container { padding: 1.2rem .8rem; }
    .form-row.four { grid-template-columns: 1fr 1fr; }
    .analyses-grid { grid-template-columns: 1fr; }
    .profile-hero { flex-direction: column; text-align: center; }
    .stats-grid { grid-template-columns: repeat(3, 1fr); }
}
