/* Dwenrell — refonte v2
 * Direction : sombre minimal tech, accent bleu électrique, Geist sans-serif,
 * bords arrondis, dot grid en fond, vibe Vercel/Linear.
 */

:root {
    --bg:           #0a0a0a;
    --bg-elev:      #111111;
    --bg-card:      #0f0f0f;
    --bg-hover:     #161616;

    --fg:           #ededed;
    --fg-2:         #a1a1a1;
    --fg-3:         #6b6b6b;
    --fg-4:         #3d3d3d;

    --border:       rgba(255, 255, 255, 0.08);
    --border-2:     rgba(255, 255, 255, 0.14);
    --border-hover: rgba(79, 124, 255, 0.45);

    --accent:       #4f7cff;
    --accent-2:     #6b91ff;
    --accent-glow:  rgba(79, 124, 255, 0.18);
    --accent-soft:  rgba(79, 124, 255, 0.10);

    --success:      #4ade80;
    --danger:       #f87171;

    --radius:       10px;
    --radius-sm:    6px;
    --radius-lg:    14px;

    --pad-x:        clamp(1.25rem, 4vw, 2rem);

    --font-sans:    'Geist', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono:    'Geist Mono', 'JetBrains Mono', ui-monospace, monospace;
}

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

html { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }

body {
    background: var(--bg);
    color: var(--fg);
    font-family: var(--font-sans);
    font-weight: 400;
    font-size: 15px;
    line-height: 1.5;
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
}

/* Dot grid en fond, atténué aux bords */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    background-image: radial-gradient(circle, rgba(255,255,255,0.04) 1px, transparent 1px);
    background-size: 28px 28px;
    pointer-events: none;
    z-index: 0;
    mask-image: radial-gradient(ellipse at center, black 30%, transparent 80%);
    -webkit-mask-image: radial-gradient(ellipse at center, black 30%, transparent 80%);
}

/* ── Type primitives ───────────────────────────────────────────── */
h1, h2, h3, h4 {
    font-family: var(--font-sans);
    letter-spacing: -0.02em;
    line-height: 1.15;
}

.mono {
    font-family: var(--font-mono);
    font-variant-numeric: tabular-nums;
}

.tag {
    display: inline-block;
    font-family: var(--font-mono);
    font-size: 0.72rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--fg-2);
    padding: 0.25rem 0.55rem;
    background: var(--bg-elev);
    border: 1px solid var(--border);
    border-radius: 999px;
}

.dim   { color: var(--fg-2); }
.dim-2 { color: var(--fg-3); }

a {
    color: var(--fg);
    text-decoration: none;
    transition: color .15s ease;
}
a:hover { color: var(--accent); }

button {
    font: inherit;
    background: none;
    border: 0;
    cursor: pointer;
    color: inherit;
}

code {
    font-family: var(--font-mono);
    font-size: 0.85em;
    padding: 0.12em 0.4em;
    background: var(--bg-elev);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--accent-2);
}

.link-accent {
    color: var(--accent);
    transition: color .15s ease;
}
.link-accent:hover { color: var(--accent-2); }

/* ── Logo mark (réutilisable) ──────────────────────────────────── */
.mark {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: url('/assets/img/logo.png') center/cover no-repeat, var(--bg-elev);
    display: inline-block;
    flex-shrink: 0;
    font-size: 0;
    color: transparent;
    box-shadow: 0 0 20px var(--accent-soft);
}
.mark--sm { width: 24px; height: 24px; }

/* ─────────────────────────────────────────────────────────────────
   LOGIN
   ───────────────────────────────────────────────────────────────── */
.login {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--pad-x);
    position: relative;
    z-index: 1;
}

/* halo bleu derrière la card */
.login::before {
    content: '';
    position: absolute;
    width: min(640px, 90vw);
    height: min(640px, 90vw);
    background: radial-gradient(circle, var(--accent-glow) 0%, transparent 65%);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
    z-index: 0;
    filter: blur(40px);
}

.login__card {
    width: 100%;
    max-width: 400px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 2.25rem;
    position: relative;
    z-index: 1;
    box-shadow:
        0 0 0 1px rgba(255,255,255,0.02),
        0 20px 60px rgba(0,0,0,0.5);
}

.login__logo {
    display: flex;
    justify-content: center;
    margin-bottom: 1.75rem;
}
.login__logo .mark {
    width: 96px;
    height: 96px;
    box-shadow: 0 0 50px var(--accent-glow);
}
.login__logo-text { display: none; }

.login__title {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 0.35rem;
}
.login__sub {
    color: var(--fg-2);
    font-size: 0.875rem;
    margin-bottom: 1.75rem;
}

.form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.form__error {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    background: rgba(248, 113, 113, 0.07);
    border: 1px solid rgba(248, 113, 113, 0.22);
    color: #fca5a5;
    padding: 0.65rem 0.85rem;
    border-radius: var(--radius);
    font-size: 0.85rem;
}

.field {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}
.field__label {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--fg-2);
}
.field__input {
    background: var(--bg);
    border: 1px solid var(--border-2);
    color: var(--fg);
    font-family: var(--font-sans);
    font-size: 0.9rem;
    padding: 0.65rem 0.85rem;
    border-radius: var(--radius);
    outline: none;
    width: 100%;
    transition: border-color .15s ease, box-shadow .15s ease;
}
.field__input:hover    { border-color: rgba(255,255,255,0.22); }
.field__input:focus    {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
}
.field__input::placeholder { color: var(--fg-3); }

/* autofill dark */
.field__input:-webkit-autofill,
.field__input:-webkit-autofill:hover,
.field__input:-webkit-autofill:focus {
    -webkit-text-fill-color: var(--fg);
    -webkit-box-shadow: 0 0 0 1000px var(--bg) inset;
    caret-color: var(--fg);
    transition: background-color 9999s ease-out;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    background: var(--accent);
    color: white;
    font-weight: 500;
    font-size: 0.9rem;
    padding: 0.7rem 1rem;
    border-radius: var(--radius);
    cursor: pointer;
    margin-top: 0.5rem;
    transition: background-color .15s ease, transform .08s ease, box-shadow .15s ease;
    box-shadow: 0 0 0 1px rgba(255,255,255,0.04) inset;
}
.btn:hover  { background: var(--accent-2); box-shadow: 0 8px 24px var(--accent-glow); }
.btn:active { transform: scale(0.99); }
.btn svg { transition: transform .15s ease; }
.btn:hover svg { transform: translateX(2px); }

.login__foot {
    margin-top: 1.75rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--border);
    font-size: 0.75rem;
    color: var(--fg-3);
    text-align: center;
}

/* ─────────────────────────────────────────────────────────────────
   TOP NAV (partagée dashboard / placeholder / 404)
   ───────────────────────────────────────────────────────────────── */
.top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.9rem var(--pad-x);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 10;
    background: rgba(10, 10, 10, 0.7);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.top__brand {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    font-weight: 500;
    font-size: 0.95rem;
    color: var(--fg);
}
.top__brand a {
    display: flex;
    align-items: center;
    gap: 0.65rem;
}
.top__brand-sub {
    color: var(--fg-3);
    font-size: 0.85rem;
    margin-left: 0.5rem;
    font-weight: 400;
}

.top__back {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--fg-2);
    padding: 0.4rem 0.7rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    transition: all .15s ease;
}
.top__back:hover {
    color: var(--fg);
    border-color: var(--border-2);
    background: var(--bg-hover);
}
.top__back svg { transition: transform .15s ease; }
.top__back:hover svg { transform: translateX(-2px); }

.top__right {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}
.top__user {
    display: none;
}
.top__logout {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--fg-2);
    padding: 0.45rem 0.85rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: transparent;
    transition: all .15s ease;
}
.top__logout:hover {
    color: var(--fg);
    border-color: var(--border-2);
    background: var(--bg-hover);
}

/* ─────────────────────────────────────────────────────────────────
   DASHBOARD
   ───────────────────────────────────────────────────────────────── */
.dash {
    max-width: 1100px;
    margin: 0 auto;
    padding: 3rem var(--pad-x) 4rem;
    position: relative;
    z-index: 1;
}

.dash__hero {
    margin-bottom: 3rem;
}
.dash__tag { margin-bottom: 1rem; }
.dash__title {
    font-size: clamp(2rem, 4vw, 2.75rem);
    font-weight: 600;
    letter-spacing: -0.03em;
    margin-bottom: 0.6rem;
}
.dash__title-accent {
    background: linear-gradient(135deg, var(--accent), #9bb5ff);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}
.dash__lede {
    color: var(--fg-2);
    font-size: 0.95rem;
    max-width: 60ch;
    line-height: 1.6;
}

.dash__sites-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.25rem;
}
.dash__sites-title {
    font-size: 0.95rem;
    font-weight: 500;
}

/* ── Grid de cards ── */
.sites {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 0.85rem;
    list-style: none;
}
.sites li { display: flex; }

.site__card {
    display: flex;
    flex-direction: column;
    width: 100%;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.15rem 1.25rem;
    transition: border-color .2s ease, background .2s ease;
}

.site__card:not(.site__card--disabled):hover {
    border-color: var(--border-hover);
    background: var(--bg-hover);
}
.site__card:not(.site__card--disabled):hover .site__arrow {
    color: var(--accent);
    transform: translate(2px, -2px);
}
.site__card:not(.site__card--disabled):hover .site__title {
    color: var(--accent-2);
}

.site__head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 0.5rem;
    margin-bottom: 0.6rem;
}
.site__title {
    font-size: 1.05rem;
    font-weight: 500;
    letter-spacing: -0.01em;
    transition: color .2s ease;
}
.site__arrow {
    color: var(--fg-3);
    transition: color .2s ease, transform .2s ease;
    flex-shrink: 0;
    margin-top: 2px;
}

.site__desc {
    color: var(--fg-2);
    font-size: 0.875rem;
    line-height: 1.5;
    flex: 1;
    margin-bottom: 1rem;
}

.site__foot {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 0.8rem;
    border-top: 1px solid var(--border);
}
.site__slug {
    color: var(--fg-3);
    font-family: var(--font-mono);
    font-size: 0.75rem;
}
.site__status {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-family: var(--font-mono);
    font-size: 0.7rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--fg-2);
}
.dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--fg-4);
}
.dot--open {
    background: var(--success);
    box-shadow: 0 0 8px rgba(74, 222, 128, 0.6);
}
.dot--closed { background: var(--fg-4); }

.site__card--disabled { cursor: not-allowed; opacity: 0.5; }

/* ── État vide ── */
.empty {
    border: 1px dashed var(--border-2);
    border-radius: var(--radius-lg);
    padding: 3.5rem 2rem;
    text-align: center;
    background: rgba(255,255,255,0.01);
}
.empty__icon {
    width: 44px;
    height: 44px;
    margin: 0 auto 1.25rem;
    border-radius: var(--radius);
    background: var(--bg-elev);
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--fg-3);
}
.empty__title {
    font-weight: 500;
    font-size: 1rem;
    margin-bottom: 0.5rem;
}
.empty__note {
    color: var(--fg-2);
    font-size: 0.875rem;
    line-height: 1.7;
    max-width: 50ch;
    margin: 0 auto;
}

/* ─────────────────────────────────────────────────────────────────
   ANIMATIONS
   ───────────────────────────────────────────────────────────────── */
@keyframes fade-up {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}

.login__card  { animation: fade-up .5s ease both; }
.dash__hero > *,
.dash__sites-head,
.empty {
    animation: fade-up .5s ease both;
}
.dash__hero > *:nth-child(1) { animation-delay: 0.05s; }
.dash__hero > *:nth-child(2) { animation-delay: 0.12s; }
.dash__hero > *:nth-child(3) { animation-delay: 0.20s; }
.dash__sites-head            { animation-delay: 0.25s; }
.empty                        { animation-delay: 0.30s; }

.sites li {
    animation: fade-up .5s ease both;
    animation-delay: calc(0.30s + var(--i, 0) * 60ms);
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
}

/* ─────────────────────────────────────────────────────────────────
   RESPONSIVE
   ───────────────────────────────────────────────────────────────── */
@media (max-width: 640px) {
    .login__card { padding: 1.75rem; }
    .top { padding: 0.75rem var(--pad-x); }
    .top__brand-sub,
    .top__user { display: none; }
    .dash { padding: 2rem var(--pad-x) 3rem; }
    .dash__hero { margin-bottom: 2rem; }
    .sites { grid-template-columns: 1fr; }
}
