/* ============================================================
   CHRONO ASTRO — app.css
   Design premium dark mode natif
   CSS3 custom, aucun framework
   ============================================================ */

/* ── Variables ────────────────────────────────────────────── */
:root {
    /* Palette principale */
    --color-bg:          #0a0a18;
    --color-bg-card:     #12122a;
    --color-bg-elevated: #1a1a35;
    --color-border:      rgba(255, 255, 255, 0.08);

    /* Accent cosmique */
    --color-primary:     #7c5cbf;
    --color-primary-light: #9b7de0;
    --color-secondary:   #e94560;
    --color-accent:      #f5a623;

    /* Texte */
    --color-text:        #e8e8f0;
    --color-text-muted:  #8888aa;
    --color-text-faint:  #555570;

    /* États */
    --color-success:     #2ecc71;
    --color-error:       #e74c3c;
    --color-warning:     #f39c12;
    --color-info:        #3498db;

    /* Typographie */
    --font-body:         'Segoe UI', system-ui, -apple-system, sans-serif;
    --font-heading:      'Segoe UI', system-ui, sans-serif;
    --font-mono:         'Fira Code', 'Cascadia Code', monospace;

    /* Tailles */
    --text-xs:   0.75rem;
    --text-sm:   0.875rem;
    --text-base: 1rem;
    --text-lg:   1.125rem;
    --text-xl:   1.25rem;
    --text-2xl:  1.5rem;
    --text-3xl:  1.875rem;
    --text-4xl:  2.25rem;
    --text-5xl:  3rem;

    /* Espacement */
    --space-1:  0.25rem;
    --space-2:  0.5rem;
    --space-3:  0.75rem;
    --space-4:  1rem;
    --space-5:  1.25rem;
    --space-6:  1.5rem;
    --space-7:  1.75rem;
    --space-8:  2rem;
    --space-10: 2.5rem;
    --space-12: 3rem;
    --space-16: 4rem;
    --space-24: 6rem;

    /* Effets */
    --radius-sm:  0.375rem;
    --radius-md:  0.75rem;
    --radius-lg:  1.25rem;
    --radius-xl:  2rem;
    --shadow-sm:  0 1px 3px rgba(0,0,0,0.4);
    --shadow-md:  0 4px 16px rgba(0,0,0,0.5);
    --shadow-lg:  0 8px 40px rgba(0,0,0,0.6);
    --glow:       0 0 20px rgba(124, 92, 191, 0.3);

    /* Layout */
    --max-width: 1200px;
    --nav-height: 70px;

    /* Transitions */
    --transition: 0.22s ease;
}

/* Thème clair (optionnel) */
[data-theme="light"] {
    --color-bg:          #f4f4f8;
    --color-bg-card:     #ffffff;
    --color-bg-elevated: #ebebf5;
    --color-border:      rgba(0, 0, 0, 0.1);
    --color-text:        #1a1a2e;
    --color-text-muted:  #555577;
    --color-text-faint:  #8888aa;
    --color-primary:     #6a4aaf;
    --color-primary-light:#7c5cbf;
    --color-secondary:   #c53a55;
}
[data-theme="light"] input,
[data-theme="light"] select,
[data-theme="light"] textarea {
    background: #fff;
    border-color: rgba(0,0,0,.15);
    color: #1a1a2e;
}
[data-theme="light"] .btn--ghost {
    color: #555577;
    border-color: rgba(0,0,0,.12);
}
[data-theme="light"] .btn--ghost:hover {
    background: rgba(0,0,0,.04);
    color: #1a1a2e;
}
[data-theme="light"] .site-header {
    background: rgba(255,255,255,.95);
    border-bottom-color: rgba(0,0,0,.08);
}
[data-theme="light"] .navbar {
    background: transparent;
}
[data-theme="light"] .navbar__logo,
[data-theme="light"] .navbar__links a {
    color: #1a1a2e;
}
[data-theme="light"] .navbar__links a:hover,
[data-theme="light"] .navbar__links a.active {
    color: #6a4aaf;
}
[data-theme="light"] .navbar__right .btn--outline {
    color: #1a1a2e;
    border-color: rgba(0,0,0,.15);
}
[data-theme="light"] .mobile-menu-btn span {
    background: #1a1a2e;
}
[data-theme="light"] .footer {
    background: #e8e8f0;
    border-top-color: rgba(0,0,0,.06);
}
[data-theme="light"] .data-card,
[data-theme="light"] .score-card,
[data-theme="light"] .themed-scores,
[data-theme="light"] .conn-badge,
[data-theme="light"] .elem-compat {
    background: #fff;
    border-color: rgba(0,0,0,.08);
}
[data-theme="light"] .alert--error {
    background: rgba(231,76,60,.08);
    border-color: rgba(231,76,60,.2);
    color: #c0392b;
}
[data-theme="light"] .alert--success {
    background: rgba(46,204,113,.08);
    border-color: rgba(46,204,113,.2);
    color: #27ae60;
}

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

html {
    scroll-behavior: smooth;
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--font-body);
    background-color: var(--color-bg);
    color: var(--color-text);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

main#main-content {
    flex: 1;
}

img, video, svg {
    display: block;
    max-width: 100%;
}

a {
    color: var(--color-primary-light);
    text-decoration: none;
    transition: color var(--transition);
}

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

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    line-height: 1.2;
    color: var(--color-text);
}

ul, ol {
    list-style: none;
}

button {
    cursor: pointer;
    font-family: inherit;
    border: none;
    background: none;
}

input, textarea, select {
    font-family: inherit;
    font-size: inherit;
}

/* ── Utilitaires ──────────────────────────────────────────── */
.container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 var(--space-6);
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0,0,0,0);
    white-space: nowrap;
}

.inline-form {
    display: inline;
}

.gradient-text {
    background: linear-gradient(135deg, var(--color-primary-light), var(--color-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ── Boutons ──────────────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-3) var(--space-6);
    border-radius: var(--radius-md);
    font-size: var(--text-sm);
    font-weight: 600;
    letter-spacing: 0.025em;
    transition: all var(--transition);
    cursor: pointer;
    border: 2px solid transparent;
    white-space: nowrap;
}

.btn--primary {
    background: linear-gradient(135deg, var(--color-primary), var(--color-secondary));
    color: #fff;
    box-shadow: var(--glow);
}

.btn--primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 30px rgba(124, 92, 191, 0.5);
    color: #fff;
}

.btn--outline {
    border-color: var(--color-primary);
    color: var(--color-primary-light);
    background: transparent;
}

.btn--outline:hover {
    background: var(--color-primary);
    color: #fff;
}

.btn--ghost {
    color: var(--color-text-muted);
    background: transparent;
}

.btn--ghost:hover {
    color: var(--color-text);
    background: var(--color-bg-elevated);
}

.btn--lg {
    padding: var(--space-4) var(--space-8);
    font-size: var(--text-base);
}

/* ── Navigation ───────────────────────────────────────────── */
.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(10, 10, 24, 0.9);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--color-border);
    height: var(--nav-height);
}

.navbar {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 var(--space-6);
    height: 100%;
    display: flex;
    align-items: center;
    gap: var(--space-8);
}

.navbar__logo {
    font-size: var(--text-xl);
    color: var(--color-text);
    flex-shrink: 0;
}

.logo-text strong {
    color: var(--color-primary-light);
}

.navbar__links {
    display: flex;
    align-items: center;
    gap: var(--space-6);
    flex: 1;
}

.navbar__links a {
    color: var(--color-text-muted);
    font-size: var(--text-sm);
    font-weight: 500;
    transition: color var(--transition);
    position: relative;
}

.navbar__links a:hover,
.navbar__links a.active {
    color: var(--color-text);
}

.navbar__links a.active::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--color-primary);
    border-radius: 2px;
}

.navbar__actions {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    margin-left: auto;
}

.navbar__burger {
    display: none;
    flex-direction: column;
    gap: 5px;
    padding: var(--space-2);
    margin-left: auto;
}

.navbar__burger span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--color-text);
    border-radius: 2px;
    transition: transform var(--transition);
}

/* ── Menu mobile (burger) ────────────────────────────────── */
.navbar__links--open,
.navbar__actions--open {
    display: flex !important;
    flex-direction: column;
    position: absolute;
    top: var(--nav-height);
    left: 0;
    right: 0;
    background: var(--color-bg);
    border-bottom: 1px solid var(--color-border);
    padding: var(--space-4) var(--space-6);
    gap: var(--space-3);
    z-index: 150;
    box-shadow: 0 8px 24px rgba(0,0,0,.4);
}

.navbar__actions--open {
    top: auto;
    border-top: 1px solid var(--color-border);
    border-bottom: none;
    box-shadow: 0 8px 24px rgba(0,0,0,.3);
}

.navbar__links--open a {
    padding: var(--space-2) 0;
    font-size: var(--text-base);
}

.navbar__links--open a::after {
    display: none;
}

/* ── Flash messages ───────────────────────────────────────── */
.flash-container {
    position: fixed;
    top: calc(var(--nav-height) + var(--space-4));
    right: var(--space-6);
    z-index: 200;
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
    max-width: 380px;
}

.flash {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: var(--space-3);
    padding: var(--space-4);
    border-radius: var(--radius-md);
    font-size: var(--text-sm);
    box-shadow: var(--shadow-lg);
    animation: slideIn 0.3s ease;
}

.flash--success { background: rgba(46,204,113,0.15); border: 1px solid var(--color-success); color: #7ef0a8; }
.flash--error   { background: rgba(231,76,60,0.15);  border: 1px solid var(--color-error);   color: #f08080; }
.flash--warning { background: rgba(243,156,18,0.15); border: 1px solid var(--color-warning); color: #f5c842; }
.flash--info    { background: rgba(52,152,219,0.15); border: 1px solid var(--color-info);    color: #80c8f0; }

.flash__close {
    color: currentColor;
    opacity: 0.6;
    flex-shrink: 0;
    font-size: var(--text-xs);
    transition: opacity var(--transition);
}

.flash__close:hover { opacity: 1; }

@keyframes slideIn {
    from { opacity: 0; transform: translateX(20px); }
    to   { opacity: 1; transform: translateX(0); }
}

/* ── Hero ─────────────────────────────────────────────────── */
.hero {
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-items: center;
    gap: var(--space-12);
    max-width: var(--max-width);
    margin: 0 auto;
    padding: var(--space-12) var(--space-6) var(--space-8);
}

.hero__title {
    font-size: var(--text-5xl);
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: var(--space-4);
}

.hero__subtitle {
    font-size: var(--text-lg);
    color: var(--color-text-muted);
    max-width: 480px;
    margin-bottom: var(--space-6);
    line-height: 1.7;
}

.hero__cta {
    display: flex;
    gap: var(--space-4);
    flex-wrap: wrap;
}

.hero__visual {
    display: flex;
    justify-content: center;
    align-items: center;
}

/* ── Météo astrale placeholder ────────────────────────────── */
.astro-weather {
    width: 320px;
    height: 320px;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, rgba(124,92,191,0.3), rgba(233,69,96,0.1), transparent);
    border: 1px solid var(--color-border);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--glow), inset 0 0 60px rgba(124,92,191,0.1);
    animation: pulse 4s ease-in-out infinite;
}

.astro-icon {
    font-size: 5rem;
    opacity: 0.7;
}

@keyframes pulse {
    0%, 100% { box-shadow: var(--glow), inset 0 0 60px rgba(124,92,191,0.1); }
    50%       { box-shadow: 0 0 40px rgba(124,92,191,0.5), inset 0 0 80px rgba(124,92,191,0.15); }
}

/* ── Features ─────────────────────────────────────────────── */
.features {
    padding: var(--space-12) var(--space-6);
    max-width: var(--max-width);
    margin: 0 auto;
}

.section__header {
    text-align: center;
    margin-bottom: var(--space-8);
}

.section__header h2 {
    font-size: var(--text-3xl);
    margin-bottom: var(--space-4);
}

.section__header p {
    color: var(--color-text-muted);
    font-size: var(--text-lg);
}

.features__grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-6);
}

.feature-card {
    background: var(--color-bg-card);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: var(--space-6);
    transition: all var(--transition);
}

.feature-card:hover {
    border-color: var(--color-primary);
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg), var(--glow);
}

.feature-card__icon {
    font-size: 2rem;
    margin-bottom: var(--space-4);
}

.feature-card h3 {
    font-size: var(--text-xl);
    margin-bottom: var(--space-3);
}

.feature-card p {
    color: var(--color-text-muted);
    font-size: var(--text-sm);
    line-height: 1.7;
}

/* ── Footer ───────────────────────────────────────────────── */

/* ── Auth pages ───────────────────────────────────────────── */
.auth-page {
    min-height: calc(100vh - var(--nav-height));
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-8) var(--space-4);
    background: radial-gradient(ellipse at 50% 0%, rgba(124,92,191,0.12), transparent 60%);
}

.auth-card {
    width: 100%;
    max-width: 440px;
    background: var(--color-bg-card);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-xl);
    padding: var(--space-12) var(--space-8);
    box-shadow: var(--shadow-lg);
}

.auth-card--wide { max-width: 580px; }

.auth-card__header {
    text-align: center;
    margin-bottom: var(--space-8);
}

.auth-card__logo {
    display: inline-block;
    font-size: var(--text-xl);
    color: var(--color-text);
    margin-bottom: var(--space-6);
}

.auth-card__header h1 {
    font-size: var(--text-2xl);
    margin-bottom: var(--space-2);
}

.auth-card__header p {
    color: var(--color-text-muted);
    font-size: var(--text-sm);
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: var(--space-5);
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}

.form-group label {
    font-size: var(--text-sm);
    font-weight: 600;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.form-label__link {
    font-weight: 400;
    font-size: var(--text-xs);
    color: var(--color-text-muted);
}

.form-label__link:hover {
    color: var(--color-primary-light);
}

.form-group input[type="email"],
.form-group input[type="password"],
.form-group input[type="text"] {
    width: 100%;
    padding: var(--space-3) var(--space-4);
    background: var(--color-bg-elevated);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    color: var(--color-text);
    font-size: var(--text-base);
    transition: border-color var(--transition);
}

.form-group input:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(124,92,191,0.15);
}

.input-wrap {
    position: relative;
}

.input-wrap input {
    padding-right: 3rem;
}

.toggle-pwd {
    position: absolute;
    right: var(--space-3);
    top: 50%;
    transform: translateY(-50%);
    opacity: 0.5;
    transition: opacity var(--transition);
    font-size: var(--text-sm);
}

.toggle-pwd:hover { opacity: 1; }

.form-group--inline { flex-direction: row; align-items: center; }

.checkbox-label {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    cursor: pointer;
    font-size: var(--text-sm);
    color: var(--color-text-muted);
}

.checkbox-label input { accent-color: var(--color-primary); }

.btn--full { width: 100%; justify-content: center; padding: var(--space-4); text-align: center; display: block; }

.auth-card__footer {
    margin-top: var(--space-6);
    text-align: center;
    font-size: var(--text-sm);
    color: var(--color-text-muted);
}

.auth-card__footer a {
    color: var(--color-primary-light);
    font-weight: 600;
}

/* ── Footer ─────────────────────────────────────────────── */
.site-footer {
    background: var(--color-bg-card);
    border-top: 1px solid var(--color-border);
    padding: var(--space-16) var(--space-6) var(--space-8);
}

.footer__inner {
    max-width: var(--max-width);
    margin: 0 auto;
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: var(--space-12);
    padding-bottom: var(--space-8);
    border-bottom: 1px solid var(--color-border);
}

.footer__brand p {
    color: var(--color-text-muted);
    font-size: var(--text-sm);
    margin-top: var(--space-3);
}

.footer__nav h4 {
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--color-text);
    margin-bottom: var(--space-4);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.footer__nav ul {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}

.footer__nav a {
    color: var(--color-text-muted);
    font-size: var(--text-sm);
    transition: color var(--transition);
}

.footer__nav a:hover {
    color: var(--color-text);
}

.footer__bottom {
    max-width: var(--max-width);
    margin: var(--space-8) auto 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.footer__bottom p {
    color: var(--color-text-faint);
    font-size: var(--text-xs);
}

.footer__version a {
    color: var(--color-text-faint);
    font-size: var(--text-xs);
}

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 1024px) {
    .features__grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .footer__inner {
        grid-template-columns: 1fr 1fr;
    }

    .footer__brand {
        grid-column: 1 / -1;
    }
}

@media (max-width: 768px) {
    :root {
        --text-5xl: 2.25rem;
        --text-3xl: 1.5rem;
    }

    .hero {
        grid-template-columns: 1fr;
        padding: var(--space-8) var(--space-6);
        text-align: center;
    }

    .hero__subtitle {
        max-width: 100%;
        margin-left: auto;
        margin-right: auto;
    }

    .hero__cta {
        justify-content: center;
    }

    .hero__visual {
        order: -1;
    }

    .astro-weather {
        width: 240px;
        height: 240px;
    }

    .navbar__links,
    .navbar__actions {
        display: none;
    }

    .navbar__burger {
        display: flex;
    }

    .features__grid {
        grid-template-columns: 1fr;
    }

    .footer__inner {
        grid-template-columns: 1fr;
        gap: var(--space-8);
    }

    .footer__bottom {
        flex-direction: column;
        gap: var(--space-2);
        text-align: center;
    }
}

/* ── Card Zoom Modal (global) ────────────────────────────── */
.zoomable-card{cursor:pointer;transition:box-shadow .2s ease,border-color .2s ease;position:relative}
.zoomable-card:hover{border-color:var(--color-primary);box-shadow:0 4px 16px rgba(124,92,191,.15)}
.zoomable-card::after{content:'⤢';position:absolute;top:8px;right:10px;font-size:.85rem;color:var(--color-text-faint);opacity:0;transition:opacity .2s;pointer-events:none}
.zoomable-card:hover::after{opacity:1}

#cardZoomOverlay{display:none;position:fixed;inset:0;background:rgba(0,0,0,.7);z-index:2000;align-items:center;justify-content:center;padding:20px;backdrop-filter:blur(4px)}
#cardZoomOverlay.open{display:flex}
.zoom-modal{background:var(--color-bg-card);border:1px solid var(--color-border);border-radius:var(--radius-xl);padding:var(--space-5);max-width:620px;width:100%;position:relative;animation:zoomIn .22s ease;box-shadow:0 24px 64px rgba(0,0,0,.4)}
@keyframes zoomIn{from{opacity:0;transform:scale(.9)}to{opacity:1;transform:scale(1)}}
.zoom-modal__close{position:absolute;top:10px;right:14px;background:none;border:none;font-size:2rem;cursor:pointer;color:var(--color-text-muted);line-height:1;padding:4px;z-index:1}
.zoom-modal__close:hover{color:var(--color-text)}
.zoom-modal__body{display:flex;align-items:center;justify-content:center}
.zoom-modal__body img{max-height:80vh}
