/* ==========================================================================
   VicProj — Design System v1.0
   Direcție: Apple Principal Designer. Negru pur, alb pur, un singur accent.
   Spațiu generos, tipografie mare, mișcare lentă și precisă.
   ========================================================================== */

:root {
    /* --- Culori: fundal --- */
    --bg: #000000;
    --bg-soft: #0b0b0d;
    --card: rgba(28, 28, 30, 0.66);
    --card-solid: #1c1c1e;
    --surface-2: #2c2c2e;

    /* --- Culori: contur --- */
    --border: rgba(255, 255, 255, 0.10);
    --border-strong: rgba(255, 255, 255, 0.20);

    /* --- Culori: text --- */
    --text: #f5f5f7;
    --text-2: rgba(235, 235, 245, 0.60);
    --text-3: rgba(235, 235, 245, 0.38);

    /* --- Culori: acțiune + semantic --- */
    --accent: #0a84ff;
    --accent-press: #0071e3;
    --success: #32d74b;
    --warn: #ffd60a;
    --danger: #ff453a;

    /* --- Raze (logo-ul VP dictează: pătrat rotunjit) --- */
    --r-logo: 22.5%;
    --r-lg: 28px;
    --r-md: 20px;
    --r-sm: 14px;
    --r-pill: 980px;

    /* --- Tipografie --- */
    --font: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text",
        "Helvetica Neue", Inter, Arial, sans-serif;
    --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;

    /* --- Mișcare --- */
    --ease: cubic-bezier(0.16, 1, 0.3, 1);

    /* --- Layout: grid 12 coloane, spațiere pe bază de 8px --- */
    --container: 1200px;
    --gutter: 24px;
}

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

html {
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

body {
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    font-family: var(--font);
    font-size: 16px;
    line-height: 1.5;
    overflow-x: hidden;
}

.hidden { display: none !important; }
a { color: inherit; }
img { user-select: none; -webkit-user-drag: none; }

/* Grăunțe de film, foarte discrete — adaugă profunzime */
.noise {
    position: fixed;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    opacity: 0.05;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)' opacity='0.6'/%3E%3C/svg%3E");
}

::selection { background: var(--text); color: var(--bg); }

/* ==========================================================================
   Tipografie — 9 niveluri
   ========================================================================== */

.t-display { font-size: clamp(3.5rem, 9vw, 7rem); font-weight: 700; letter-spacing: -0.045em; line-height: 0.98; }
.t-h1      { font-size: clamp(2.75rem, 7vw, 5rem); font-weight: 700; letter-spacing: -0.04em; line-height: 1.02; }
.t-h2      { font-size: clamp(2rem, 4.6vw, 3.25rem); font-weight: 600; letter-spacing: -0.03em; line-height: 1.06; }
.t-h3      { font-size: clamp(1.5rem, 3vw, 2.125rem); font-weight: 600; letter-spacing: -0.02em; line-height: 1.12; }
.t-title   { font-size: 1.375rem; font-weight: 600; letter-spacing: -0.015em; }
.t-body-lg { font-size: 1.1875rem; color: var(--text-2); line-height: 1.6; }
.t-body    { font-size: 1rem; line-height: 1.6; }
.t-small   { font-size: 0.875rem; line-height: 1.45; }
.t-tiny    { font-size: 0.75rem; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; color: var(--text-3); }

/* ==========================================================================
   Navigare
   ========================================================================== */

.nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 50;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px clamp(20px, 4vw, 44px);
    background: rgba(0, 0, 0, 0.72);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-bottom: 1px solid var(--border);
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    background: none;
    border: none;
    color: var(--text);
    font-family: var(--font);
    font-size: 16px;
    font-weight: 700;
    letter-spacing: -0.01em;
    cursor: pointer;
}
.nav-logo { height: 26px; width: 26px; border-radius: 7px; display: block; }

.nav-admin {
    background: none;
    border: none;
    color: var(--text-3);
    font-family: var(--font);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    padding: 8px 14px;
    border-radius: var(--r-pill);
    transition: color 0.2s ease, background 0.2s ease;
}
.nav-admin:hover { color: var(--text); background: var(--surface-2); }

/* ==========================================================================
   Vederi / tranziții de pagină
   ========================================================================== */

main { position: relative; z-index: 2; }
.view { display: none; }
.view.active { display: block; }
.page-in { animation: page-in 0.7s var(--ease); }
@keyframes page-in {
    from { opacity: 0; transform: translateY(18px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Reveal la scroll */
[data-reveal] {
    opacity: 0;
    transform: translateY(36px);
    transition: opacity 1s var(--ease), transform 1s var(--ease);
}
[data-reveal].in { opacity: 1; transform: translateY(0); }

/* ==========================================================================
   Hero
   ========================================================================== */

.hero {
    min-height: 100svh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 120px var(--gutter) 80px;
    max-width: var(--container);
    margin: 0 auto;
}

.hero-logo-wrap { will-change: transform; }

.hero-logo {
    width: clamp(150px, 22vw, 230px);
    height: auto;
    border-radius: var(--r-logo);
    border: 1px solid var(--border-strong);
    box-shadow:
        0 0 0 1px rgba(0, 0, 0, 0.6),
        0 30px 80px rgba(0, 0, 0, 0.8),
        0 0 90px rgba(255, 255, 255, 0.07);
    animation: float 7s ease-in-out infinite;
}
@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-12px); }
}

.hero-eyebrow {
    margin-top: 44px;
    font-size: 0.8125rem;
    font-weight: 700;
    letter-spacing: 0.32em;
    text-transform: uppercase;
    color: var(--text-3);
}

.hero-title {
    font-size: clamp(3.5rem, 10vw, 8rem);
    font-weight: 700;
    letter-spacing: -0.045em;
    line-height: 0.98;
    margin-top: 18px;
}
.hero-title .line { display: block; overflow: hidden; }
.hero-title .line > span {
    display: block;
    transform: translateY(112%);
    animation: rise 1.1s var(--ease) forwards;
}
.hero-title .line:nth-child(2) > span { animation-delay: 0.12s; }
.hero-title .line:nth-child(3) > span { animation-delay: 0.24s; }
.hero-title .dim { color: var(--text-3); }
@keyframes rise { to { transform: translateY(0); } }

.hero-sub {
    margin-top: 28px;
    font-size: clamp(1.0625rem, 2vw, 1.375rem);
    color: var(--text-2);
    max-width: 460px;
}

.hero-cta { margin-top: 48px; }

/* ==========================================================================
   Butoane
   ========================================================================== */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: var(--text);
    color: var(--bg);
    border: none;
    border-radius: var(--r-pill);
    padding: 13px 28px;
    font-family: var(--font);
    font-size: 15px;
    font-weight: 600;
    letter-spacing: -0.01em;
    cursor: pointer;
    text-decoration: none;
    transition: transform 0.18s var(--ease), opacity 0.2s ease, background 0.2s ease, box-shadow 0.3s ease;
}
.btn:hover { transform: scale(1.03); }
.btn:active { transform: scale(0.96); }
.btn:disabled { opacity: 0.4; cursor: default; transform: none; }

.btn-primary {
    background: var(--text);
    color: var(--bg);
    box-shadow: 0 0 0 0 rgba(255, 255, 255, 0);
}
.btn-primary:hover { box-shadow: 0 8px 40px rgba(255, 255, 255, 0.18); }

.btn-xl { padding: 19px 44px; font-size: 18px; }
.btn-lg { padding: 16px 36px; font-size: 16px; }
.btn-sm { padding: 8px 16px; font-size: 13px; }
.btn-block { width: 100%; }

.btn-outline {
    background: rgba(255, 255, 255, 0.06);
    color: var(--text);
    border: 1px solid var(--border-strong);
}
.btn-outline:hover { background: rgba(255, 255, 255, 0.12); box-shadow: none; }

.btn-ghost {
    background: none;
    color: var(--text-2);
}
.btn-ghost:hover { color: var(--text); background: var(--surface-2); box-shadow: none; }

.btn-danger { background: var(--danger); color: #fff; }

/* ==========================================================================
   Marquee editorial
   ========================================================================== */

.marquee {
    overflow: hidden;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    padding: 26px 0;
    user-select: none;
}
.marquee-track {
    display: flex;
    width: max-content;
    animation: marquee 46s linear infinite;
}
.marquee-track span {
    font-size: clamp(2.25rem, 5.5vw, 4.5rem);
    font-weight: 700;
    letter-spacing: -0.03em;
    white-space: nowrap;
    color: transparent;
    -webkit-text-stroke: 1px rgba(255, 255, 255, 0.22);
    padding-right: 24px;
}
@keyframes marquee {
    from { transform: translateX(0); }
    to { transform: translateX(-50%); }
}

/* ==========================================================================
   Capitole (manifest numerotat)
   ========================================================================== */

.chapters {
    max-width: var(--container);
    margin: 0 auto;
    padding: 160px var(--gutter);
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    row-gap: 120px;
}
.chapter { grid-column: 1 / span 6; }
.chapter.right { grid-column: 7 / span 6; text-align: right; }
.chapter.center { grid-column: 1 / -1; text-align: center; }
.chapter.center p { margin-left: auto; margin-right: auto; }
.chapter-no {
    font-family: var(--mono);
    font-size: 0.9375rem;
    color: var(--text-3);
    letter-spacing: 0.2em;
}
.chapter h2 {
    font-size: clamp(2.25rem, 5vw, 4rem);
    font-weight: 700;
    letter-spacing: -0.035em;
    line-height: 1.04;
    margin-top: 18px;
}
.chapter p {
    margin-top: 16px;
    font-size: 1.1875rem;
    color: var(--text-2);
    max-width: 380px;
}
.chapter.right p { margin-left: auto; }

/* ==========================================================================
   Declarație + CTA final
   ========================================================================== */

.statement {
    text-align: center;
    padding: 140px var(--gutter);
    border-top: 1px solid var(--border);
}
.statement h2 {
    font-size: clamp(2.75rem, 7vw, 5.5rem);
    font-weight: 700;
    letter-spacing: -0.04em;
    line-height: 1.02;
}

.final-cta {
    max-width: 720px;
    margin: 0 auto 140px;
    padding: 80px 40px;
    text-align: center;
    background: var(--card);
    backdrop-filter: blur(24px) saturate(160%);
    -webkit-backdrop-filter: blur(24px) saturate(160%);
    border: 1px solid var(--border);
    border-radius: 40px;
    margin-left: max(var(--gutter), calc((100% - 720px) / 2));
    margin-right: max(var(--gutter), calc((100% - 720px) / 2));
}
.final-logo {
    width: 84px;
    border-radius: var(--r-logo);
    border: 1px solid var(--border-strong);
    margin-bottom: 32px;
}
.final-cta h2 {
    font-size: clamp(2.25rem, 5vw, 3.75rem);
    font-weight: 700;
    letter-spacing: -0.035em;
    margin-bottom: 36px;
}

/* ==========================================================================
   Footer
   ========================================================================== */

.footer {
    border-top: 1px solid var(--border);
    padding: 48px var(--gutter);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    color: var(--text-3);
    font-size: 13px;
    font-weight: 600;
}
.footer-logo { width: 20px; height: 20px; border-radius: 5px; }

/* ==========================================================================
   Pagina de cod (pasul 1: 9 cifre · pasul 2: 6 cifre)
   ========================================================================== */

.code-wrap {
    min-height: 100svh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 120px var(--gutter) 80px;
    max-width: 720px;
    margin: 0 auto;
}

.step-label {
    font-family: var(--mono);
    font-size: 0.8125rem;
    letter-spacing: 0.24em;
    text-transform: uppercase;
    color: var(--text-3);
}
.code-title {
    font-size: clamp(2.5rem, 6vw, 4.5rem);
    font-weight: 700;
    letter-spacing: -0.04em;
    line-height: 1.02;
    margin-top: 20px;
}
.code-sub { margin-top: 14px; font-size: 1.125rem; color: var(--text-2); }

.digits {
    display: flex;
    gap: clamp(6px, 1.4vw, 12px);
    justify-content: center;
    margin: 44px 0 6px;
    width: 100%;
}
.digit {
    flex: 0 1 auto;
    width: clamp(34px, 6.2vw, 54px);
    height: clamp(48px, 8.6vw, 68px);
    text-align: center;
    font-family: var(--font);
    font-size: clamp(20px, 3.2vw, 30px);
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border);
    border-radius: 16px;
    color: var(--text);
    outline: none;
    caret-color: var(--accent);
    transition: border-color 0.2s ease, background 0.2s ease, transform 0.16s var(--ease);
}
.digit:focus {
    border-color: var(--text);
    background: rgba(255, 255, 255, 0.08);
    transform: translateY(-3px);
}
.digit.filled { border-color: var(--border-strong); background: rgba(255, 255, 255, 0.06); }

.shake { animation: shake 0.45s var(--ease); }
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    20% { transform: translateX(-10px); }
    40% { transform: translateX(9px); }
    60% { transform: translateX(-6px); }
    80% { transform: translateX(4px); }
}

.inline-error {
    min-height: 22px;
    margin-top: 14px;
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--danger);
}

.code-actions {
    margin-top: 30px;
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
    justify-content: center;
}

/* ==========================================================================
   Pagina fișierului + pagina de eroare
   ========================================================================== */

.file-card, .error-wrap {
    min-height: 100svh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 120px var(--gutter) 80px;
    max-width: 640px;
    margin: 0 auto;
}

.file-icon {
    width: 92px;
    height: 92px;
    border-radius: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 34px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--border-strong);
}
.file-icon.ok { color: var(--success); }
.file-icon.warn { color: var(--warn); }
.file-icon.error { color: var(--danger); }
.file-icon svg { width: 42px; height: 42px; stroke: currentColor; fill: none; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }

.file-name {
    font-size: clamp(1.75rem, 4.4vw, 3rem);
    font-weight: 700;
    letter-spacing: -0.03em;
    line-height: 1.08;
    word-break: break-word;
}
.file-meta { margin-top: 14px; font-size: 1.0625rem; color: var(--text-2); }
.file-desc {
    margin-top: 24px;
    font-size: 1rem;
    color: var(--text-2);
    line-height: 1.65;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    padding: 20px 24px;
    max-width: 480px;
    text-align: left;
}
#file-action { margin-top: 40px; width: 100%; max-width: 340px; }
#file-action .muted-note { font-size: 0.9375rem; color: var(--text-2); }

.error-logo {
    width: 92px;
    border-radius: var(--r-logo);
    border: 1px solid var(--border-strong);
    margin-bottom: 40px;
    opacity: 0.9;
}
.error-wrap h2 {
    font-size: clamp(2.5rem, 6vw, 4.25rem);
    font-weight: 700;
    letter-spacing: -0.04em;
}
.error-msg {
    margin-top: 20px;
    font-size: clamp(1.0625rem, 2vw, 1.3125rem);
    color: var(--text-2);
    max-width: 460px;
    line-height: 1.55;
}
.error-hint {
    margin-top: 18px;
    font-size: 0.875rem;
    color: var(--text-3);
    max-width: 420px;
}
.error-wrap .btn { margin-top: 44px; }

/* ==========================================================================
   Admin
   ========================================================================== */

.admin-wrap {
    max-width: 860px;
    margin: 0 auto;
    padding: 130px var(--gutter) 100px;
}
.admin-login { max-width: 400px; margin: 0 auto; text-align: left; }
.admin-login h2 { font-size: clamp(2.25rem, 5vw, 3.5rem); font-weight: 700; letter-spacing: -0.035em; }
.admin-login .muted-sub { margin: 12px 0 32px; color: var(--text-2); font-size: 1.0625rem; }

.panel-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin-bottom: 28px;
}
.panel-head h2 { font-size: clamp(2rem, 4.5vw, 3rem); font-weight: 700; letter-spacing: -0.035em; }

.card {
    background: var(--card);
    backdrop-filter: blur(24px) saturate(160%);
    -webkit-backdrop-filter: blur(24px) saturate(160%);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    padding: 28px;
    margin-bottom: 20px;
}
.card h3 { font-size: 1.0625rem; font-weight: 700; letter-spacing: -0.01em; margin-bottom: 6px; }
.card .card-sub { font-size: 0.8125rem; color: var(--text-2); margin-bottom: 18px; }

.form-group { margin-bottom: 16px; }
.form-group:last-child { margin-bottom: 0; }
label {
    display: block;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text-2);
    margin-bottom: 8px;
}
input[type="text"], input[type="password"], input[type="file"], select, textarea {
    width: 100%;
    padding: 13px 16px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    color: var(--text);
    border-radius: var(--r-sm);
    outline: none;
    font-size: 15px;
    font-family: var(--font);
    transition: border-color 0.18s ease, background 0.18s ease;
}
textarea { resize: vertical; min-height: 84px; }
input::placeholder, textarea::placeholder { color: var(--text-3); }
input:focus, select:focus, textarea:focus {
    border-color: var(--text);
    background: rgba(255, 255, 255, 0.08);
}
select option { background: var(--card-solid); color: var(--text); }
input[type="file"] { padding: 11px 14px; cursor: pointer; }

.code-box {
    background: rgba(255, 255, 255, 0.05);
    border: 1px dashed var(--border-strong);
    padding: 16px;
    border-radius: var(--r-sm);
    font-family: var(--mono);
    font-size: 0.8125rem;
    word-break: break-all;
    margin: 12px 0;
    color: var(--text-2);
}
.reveal-pin {
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: 0.3em;
    text-align: center;
    padding: 18px;
    font-variant-numeric: tabular-nums;
}

.table-responsive { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; text-align: left; font-size: 0.875rem; }
th, td { padding: 15px 14px; border-bottom: 1px solid var(--border); }
th { font-size: 0.75rem; font-weight: 600; color: var(--text-2); text-transform: uppercase; letter-spacing: 0.08em; }
tr:last-child td { border-bottom: none; }

.badge {
    display: inline-flex;
    align-items: center;
    padding: 5px 12px;
    border-radius: var(--r-pill);
    font-size: 0.75rem;
    font-weight: 600;
}
.badge-active { background: rgba(50, 215, 75, 0.14); color: var(--success); }
.badge-paused { background: rgba(255, 214, 10, 0.14); color: var(--warn); }
.badge-blocked { background: rgba(255, 69, 58, 0.14); color: var(--danger); }

.admin-toolbar {
    display: flex;
    gap: 12px;
    margin-bottom: 18px;
    flex-wrap: wrap;
}
.admin-toolbar input { flex: 1; min-width: 180px; }
.admin-toolbar select { max-width: 200px; }

/* ==========================================================================
   Toast-uri
   ========================================================================== */

#toast-container {
    position: fixed;
    top: 76px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-width: 340px;
}
.toast {
    background: rgba(28, 28, 30, 0.92);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    color: var(--text);
    border: 1px solid var(--border-strong);
    padding: 14px 18px;
    border-radius: var(--r-sm);
    font-size: 0.8125rem;
    font-weight: 500;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.6);
    animation: toast-in 0.35s var(--ease);
}
.toast.error { border-color: rgba(255, 69, 58, 0.55); }
.toast.success { border-color: rgba(50, 215, 75, 0.55); }
@keyframes toast-in {
    from { opacity: 0; transform: translateY(-10px) scale(0.97); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

/* ==========================================================================
   Responsive + accesibilitate
   ========================================================================== */

@media (max-width: 860px) {
    .chapters { padding: 110px var(--gutter); row-gap: 90px; }
    .chapter, .chapter.right, .chapter.center { grid-column: 1 / -1; text-align: left; }
    .chapter.right p, .chapter.center p { margin-left: 0; }
    .final-cta { padding: 56px 24px; border-radius: 32px; margin-bottom: 100px; }
    .card { padding: 22px; }
    .admin-toolbar select { max-width: none; width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    .page-in, .hero-logo, .marquee-track,
    .hero-title .line > span { animation: none !important; }
    .hero-title .line > span { transform: none; }
    [data-reveal] { opacity: 1; transform: none; transition: none; }
    * { transition-duration: 0.01ms !important; }
}
