/* ==========================================================================
   redemo — client portal
   Dark dev-tool aesthetic. One file, no framework, no external assets.
   ========================================================================== */

:root {
    --bg: #0b0f14;
    --bg-glow: rgba(45, 212, 167, 0.055);
    --panel: #101720;
    --panel-raised: #131c27;
    --border: #1d2836;
    --border-strong: #2a3a48;
    --text: #e8eef4;
    --muted: #8b98a9;
    --faint: #5c6a7c;
    --accent: #2dd4a7;
    --accent-strong: #19b78c;
    --accent-ink: #062019;
    --accent-dim: rgba(45, 212, 167, 0.12);
    --danger: #f0716f;
    --danger-dim: rgba(240, 113, 111, 0.12);
    --warn: #e8b24a;
    --warn-dim: rgba(232, 178, 74, 0.13);
    --info-dim: rgba(122, 162, 247, 0.12);
    --info: #7aa2f7;
    --radius: 10px;
    --radius-lg: 14px;
    --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
    --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
}

* { box-sizing: border-box; }

html { height: 100%; }

body {
    margin: 0;
    min-height: 100%;
    background-color: var(--bg);
    background-image:
        radial-gradient(900px 480px at 75% -120px, var(--bg-glow), transparent 65%),
        linear-gradient(rgba(255, 255, 255, 0.015) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.015) 1px, transparent 1px);
    background-size: auto, 36px 36px, 36px 36px;
    color: var(--text);
    font-family: var(--font);
    font-size: 15px;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
}

.page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.shell {
    width: 100%;
    max-width: 1040px;
    margin: 0 auto;
    padding: 0 20px;
}

.main { flex: 1; padding-top: 36px; padding-bottom: 64px; }

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }

h1, h2, h3 { line-height: 1.2; letter-spacing: -0.02em; margin: 0 0 8px; }
h1 { font-size: 26px; font-weight: 700; }
h2 { font-size: 18px; font-weight: 650; }
h3 { font-size: 15px; font-weight: 600; }

.muted { color: var(--muted); }
.mono { font-family: var(--mono); font-size: 0.86em; }

/* --------------------------------------------------------------------------
   Header / footer
   -------------------------------------------------------------------------- */

.site-header {
    border-bottom: 1px solid var(--border);
    background: rgba(11, 15, 20, 0.85);
    backdrop-filter: blur(6px);
    position: sticky;
    top: 0;
    z-index: 10;
}

.site-header__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 58px;
}

.brand {
    font-family: var(--mono);
    font-size: 17px;
    font-weight: 700;
    letter-spacing: -0.04em;
    color: var(--text);
    display: inline-flex;
    align-items: center;
    gap: 9px;
}
.brand:hover { text-decoration: none; }
.brand__dot { color: var(--accent); }
.brand__mark {
    width: 18px;
    height: 18px;
    border-radius: 5px;
    border: 1px solid var(--border);
    background:
        linear-gradient(135deg, rgba(45, 212, 167, 0.25), transparent 60%),
        var(--panel-raised);
    position: relative;
    display: inline-block;
}
.brand__mark::after {
    content: "";
    position: absolute;
    left: 6px;
    top: 4.5px;
    border-left: 7px solid var(--accent);
    border-top: 4.5px solid transparent;
    border-bottom: 4.5px solid transparent;
}

.nav { display: flex; align-items: center; gap: 18px; }
.nav__link { color: var(--muted); font-size: 14px; font-weight: 500; }
.nav__link:hover { color: var(--text); text-decoration: none; }
.nav__link--admin { color: var(--warn); }
.nav__link--quiet { color: var(--faint); }
.nav__user {
    font-family: var(--mono);
    font-size: 12px;
    color: var(--faint);
    max-width: 220px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.site-footer {
    border-top: 1px solid var(--border);
    padding: 18px 0 26px;
    color: var(--faint);
    font-size: 13px;
}
.site-footer__tag { font-family: var(--mono); color: var(--muted); }

/* --------------------------------------------------------------------------
   Layout primitives
   -------------------------------------------------------------------------- */

.card {
    background: linear-gradient(180deg, var(--panel-raised), var(--panel));
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px;
}
.card--flush { padding: 0; overflow: hidden; }
.card--link { display: block; color: inherit; transition: border-color 120ms ease, transform 120ms ease; }
.card--link:hover { text-decoration: none; border-color: var(--accent-strong); transform: translateY(-1px); }

.section { margin-bottom: 20px; }
.section__head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
}
.subhead { margin: 22px 0 10px; color: var(--muted); text-transform: uppercase; font-family: var(--mono); font-size: 11.5px; letter-spacing: 0.08em; }

.narrow { max-width: 620px; margin: 0 auto; }

.page-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 24px;
}
.page-head--stack { display: block; }
.page-head__meta { color: var(--muted); font-size: 13.5px; margin: 4px 0 0; font-family: var(--mono); }
.page-head h1 { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 0; }

.kicker {
    font-family: var(--mono);
    font-size: 11.5px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--accent);
    margin: 0 0 6px;
}
.kicker a { color: inherit; }

.lede { color: var(--muted); margin: 8px 0 0; }

.stack > * + * { margin-top: 16px; }

.meta-line { color: var(--muted); font-size: 13px; font-family: var(--mono); }

.empty { text-align: center; padding: 28px 12px; }
.empty h2 { margin-bottom: 6px; }

/* --------------------------------------------------------------------------
   Flashes
   -------------------------------------------------------------------------- */

.flash {
    border: 1px solid var(--border);
    border-left: 3px solid var(--accent);
    background: var(--accent-dim);
    border-radius: var(--radius);
    padding: 11px 14px;
    font-size: 14px;
    margin-bottom: 16px;
}
.flash--error { border-left-color: var(--danger); background: var(--danger-dim); }
.flash--info { border-left-color: var(--info); background: var(--info-dim); }

/* --------------------------------------------------------------------------
   Buttons
   -------------------------------------------------------------------------- */

.btn {
    display: inline-block;
    font: inherit;
    font-size: 14px;
    font-weight: 600;
    padding: 9px 18px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: var(--panel-raised);
    color: var(--text);
    cursor: pointer;
    transition: background 120ms ease, border-color 120ms ease, transform 80ms ease;
}
.btn:hover { text-decoration: none; border-color: var(--accent-strong); }
.btn:active { transform: translateY(1px); }

.btn--primary {
    background: linear-gradient(180deg, var(--accent), var(--accent-strong));
    border-color: var(--accent-strong);
    color: var(--accent-ink);
}
.btn--primary:hover { filter: brightness(1.07); }

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

.btn--block { display: block; width: 100%; text-align: center; }
.btn--lg { padding: 12px 24px; font-size: 15px; }
.btn--sm { padding: 4px 10px; font-size: 12.5px; border-radius: 7px; }

/* --------------------------------------------------------------------------
   Badges
   -------------------------------------------------------------------------- */

.badge {
    display: inline-block;
    font-family: var(--mono);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.04em;
    padding: 3px 9px;
    border-radius: 999px;
    border: 1px solid transparent;
    vertical-align: middle;
    white-space: nowrap;
}
.badge--submitted { color: var(--info); background: var(--info-dim); border-color: rgba(122, 162, 247, 0.3); }
.badge--in_production { color: var(--warn); background: var(--warn-dim); border-color: rgba(232, 178, 74, 0.32); }
.badge--preview_ready { color: var(--accent); background: var(--accent-dim); border-color: rgba(45, 212, 167, 0.35); }
.badge--active { color: var(--accent-ink); background: var(--accent); border-color: var(--accent-strong); }
.badge--paused { color: var(--muted); background: rgba(139, 152, 169, 0.12); border-color: rgba(139, 152, 169, 0.3); }
.badge--preview { color: var(--info); background: var(--info-dim); border-color: rgba(122, 162, 247, 0.3); }
.badge--paid { color: var(--accent); background: var(--accent-dim); border-color: rgba(45, 212, 167, 0.35); }
.badge--unpaid { color: var(--muted); background: rgba(139, 152, 169, 0.12); border-color: rgba(139, 152, 169, 0.3); }
.badge--regen-pending { color: var(--warn); background: var(--warn-dim); border-color: rgba(232, 178, 74, 0.32); }
.badge--regen-in_progress { color: var(--info); background: var(--info-dim); border-color: rgba(122, 162, 247, 0.3); }
.badge--regen-done { color: var(--accent); background: var(--accent-dim); border-color: rgba(45, 212, 167, 0.35); }

/* --------------------------------------------------------------------------
   Auth screens
   -------------------------------------------------------------------------- */

.auth {
    max-width: 460px;
    margin: 6vh auto 0;
}
.auth__intro { text-align: center; margin-bottom: 28px; }
.auth__headline { font-size: 30px; margin-bottom: 12px; }
.auth__headline em { font-style: normal; color: var(--accent); }
.auth__sub { color: var(--muted); margin: 0; }
.auth__card { padding: 28px; }
.auth__card--confirm { text-align: center; padding: 40px 28px; }
.mail-glyph {
    font-size: 26px;
    width: 56px;
    height: 56px;
    line-height: 56px;
    margin: 0 auto 14px;
    border-radius: 50%;
    background: var(--accent-dim);
    border: 1px solid rgba(45, 212, 167, 0.35);
}
.mono-highlight {
    font-family: var(--mono);
    font-size: 15px;
    color: var(--accent);
    background: var(--accent-dim);
    border-radius: 8px;
    display: inline-block;
    padding: 6px 14px;
    margin: 4px 0 12px;
}

/* --------------------------------------------------------------------------
   Forms (hand-written and Symfony-generated markup)
   -------------------------------------------------------------------------- */

.field label,
form label {
    display: block;
    font-family: var(--mono);
    font-size: 11.5px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 6px;
}

form > div { margin-bottom: 16px; }
form > div:last-of-type { margin-bottom: 0; }

input[type="text"],
input[type="email"],
input[type="url"],
textarea,
select {
    width: 100%;
    font: inherit;
    font-size: 14.5px;
    color: var(--text);
    background: #0d1319;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 10px 12px;
    transition: border-color 120ms ease, box-shadow 120ms ease;
}
textarea { resize: vertical; min-height: 70px; }

input:focus-visible,
textarea:focus-visible,
select:focus-visible,
.btn:focus-visible,
a:focus-visible {
    outline: none;
    border-color: var(--accent-strong);
    box-shadow: 0 0 0 3px rgba(45, 212, 167, 0.22);
}
a:focus-visible { border-radius: 4px; }

input::placeholder, textarea::placeholder { color: var(--faint); }

input[type="file"] {
    width: 100%;
    color: var(--muted);
    font-size: 13.5px;
    background: #0d1319;
    border: 1px dashed var(--border);
    border-radius: var(--radius);
    padding: 14px 12px;
}
input[type="file"]::file-selector-button {
    font: inherit;
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    background: var(--panel-raised);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 6px 12px;
    margin-right: 12px;
    cursor: pointer;
}

select {
    appearance: none;
    background-image:
        linear-gradient(45deg, transparent 50%, var(--muted) 50%),
        linear-gradient(135deg, var(--muted) 50%, transparent 50%);
    background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%;
    background-size: 5px 5px;
    background-repeat: no-repeat;
    padding-right: 36px;
}

.check {
    display: flex;
    align-items: center;
    gap: 9px;
    font-size: 14px;
    color: var(--text);
    text-transform: none;
    letter-spacing: 0;
    font-family: var(--font);
}
.check input { accent-color: var(--accent-strong); width: 16px; height: 16px; }
.check span { color: var(--text); }

.help-text, .hint {
    font-size: 12.5px;
    color: var(--faint);
    margin: 6px 0 0;
}
.hint--center { text-align: center; }
.hint a { color: var(--muted); text-decoration: underline; text-underline-offset: 3px; }

.field__error,
form ul {
    list-style: none;
    color: var(--danger);
    font-size: 13px;
    margin: 6px 0 0;
    padding: 0;
}

/* --------------------------------------------------------------------------
   Dashboard cards
   -------------------------------------------------------------------------- */

.grid-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 16px;
}

.project-card__top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 4px;
}
.project-card__name { margin: 0; font-size: 16.5px; }
.project-card__url {
    font-family: var(--mono);
    font-size: 12.5px;
    color: var(--faint);
    margin: 0 0 14px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.project-card__meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    font-size: 12.5px;
    color: var(--muted);
    border-top: 1px solid var(--border);
    padding-top: 12px;
}

/* --------------------------------------------------------------------------
   Status timeline
   -------------------------------------------------------------------------- */

.timeline {
    list-style: none;
    display: flex;
    margin: 6px 0 0;
    padding: 0;
}
.timeline__step {
    flex: 1;
    position: relative;
    text-align: center;
    padding-top: 26px;
}
.timeline__dot {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--panel);
    border: 2px solid var(--border);
    z-index: 1;
}
/* connector line */
.timeline__step::before {
    content: "";
    position: absolute;
    top: 6px;
    left: -50%;
    width: 100%;
    height: 2px;
    background: var(--border);
}
.timeline__step:first-child::before { display: none; }

.timeline__step--done .timeline__dot,
.timeline__step--current .timeline__dot {
    background: var(--accent);
    border-color: var(--accent-strong);
}
.timeline__step--done::before,
.timeline__step--current::before { background: var(--accent-strong); }
.timeline__step--current .timeline__dot {
    box-shadow: 0 0 0 5px rgba(45, 212, 167, 0.18);
}

.timeline__label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--faint);
}
.timeline__hint { display: block; font-size: 11.5px; color: var(--faint); opacity: 0.75; }
.timeline__step--done .timeline__label { color: var(--muted); }
.timeline__step--current .timeline__label { color: var(--accent); }
.timeline__step--current .timeline__hint { color: var(--muted); opacity: 1; }

.timeline--paused { opacity: 0.45; }
.timeline__paused-note {
    margin: 14px 0 0;
    font-size: 13.5px;
    color: var(--warn);
    background: var(--warn-dim);
    border: 1px solid rgba(232, 178, 74, 0.32);
    border-radius: var(--radius);
    padding: 10px 14px;
}

/* --------------------------------------------------------------------------
   Video player + versions
   -------------------------------------------------------------------------- */

.player {
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    background: #000;
    box-shadow: 0 20px 50px -30px rgba(45, 212, 167, 0.25);
    margin-top: 12px;
}
.player video { display: block; width: 100%; aspect-ratio: 16 / 9; }

.release-note { color: var(--muted); font-size: 14px; margin: 0; }

.versions { list-style: none; margin: 0; padding: 0; }
.versions__row {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 9px 2px;
    border-bottom: 1px solid var(--border);
    font-size: 13.5px;
}
.versions__row:last-child { border-bottom: none; }
.versions__row--current { background: var(--accent-dim); border-radius: 8px; padding-left: 10px; padding-right: 10px; }
.versions__note {
    flex: 1;
    color: var(--muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.row-actions { display: flex; gap: 6px; }
.row-actions form { display: inline; margin: 0; }

/* --------------------------------------------------------------------------
   Upsell block
   -------------------------------------------------------------------------- */

.section--upsell {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    flex-wrap: wrap;
    border-color: rgba(45, 212, 167, 0.4);
    background:
        radial-gradient(400px 160px at 12% 0%, rgba(45, 212, 167, 0.12), transparent 70%),
        linear-gradient(180deg, var(--panel-raised), var(--panel));
}
.section--upsell h2 { margin-bottom: 4px; }
.section--upsell p { margin: 0; color: var(--muted); }
.section--upsell strong { color: var(--accent); }

/* --------------------------------------------------------------------------
   Tables & admin
   -------------------------------------------------------------------------- */

.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th {
    text-align: left;
    font-family: var(--mono);
    font-size: 11px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--faint);
    font-weight: 600;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
}
.table td { padding: 11px 16px; border-bottom: 1px solid var(--border); }
.table tbody tr:last-child td { border-bottom: none; }
.table tbody tr:hover { background: rgba(255, 255, 255, 0.015); }

.admin-columns {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 300px;
    gap: 20px;
    align-items: start;
}
.admin-columns__side { position: sticky; top: 78px; display: grid; gap: 20px; }
.admin-columns__side .section { margin-bottom: 0; }

.kv { display: grid; grid-template-columns: 140px minmax(0, 1fr); gap: 8px 16px; margin: 0; }
.kv dt {
    font-family: var(--mono);
    font-size: 11.5px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--faint);
    padding-top: 2px;
}
.kv dd { margin: 0; overflow-wrap: anywhere; }

.prewrap {
    font-family: var(--mono);
    font-size: 12.5px;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    background: #0d1319;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 10px 12px;
    margin: 0;
    color: var(--muted);
}
.credentials { color: var(--warn); border-color: rgba(232, 178, 74, 0.25); }

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */

@media (max-width: 860px) {
    .admin-columns { grid-template-columns: 1fr; }
    .admin-columns__side { position: static; }
}

@media (max-width: 640px) {
    .nav { gap: 12px; }
    .nav__user { display: none; }
    .page-head { flex-direction: column; align-items: flex-start; }
    .timeline__hint { display: none; }
    .versions__row { flex-wrap: wrap; }
    .auth { margin-top: 2vh; }
    .auth__headline { font-size: 25px; }
}
