/* ============================================================
   UNDE SCHIEM - sistem de design
   Font: Big Shoulders Display (titluri), Work Sans (text),
   IBM Plex Mono (cifre: altitudine, temperatura, grosime zapada)
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Big+Shoulders+Display:wght@600;700;800;900&family=Work+Sans:wght@400;500;600;700&family=IBM+Plex+Mono:wght@500;600&display=swap');

:root {
    /* culori de brand */
    --ink: #000040;
    --ink-70: #2b2b63;
    --ink-40: #6b6b8f;
    --paper: #f8f8f8;
    --white: #ffffff;
    --coral: #f88038;
    --coral-dark: #dd6a24;
    --salmon: #f8a880;
    --line: #e3e3e8;

    /* culori semantice pentru dificultatea reala a partiilor */
    --piste-verde: #2f9e44;
    --piste-albastru: #1971c2;
    --piste-rosu: #e03131;
    --piste-negru: #16161a;

    --radius-s: 3px;
    --radius-m: 6px;
    --radius-l: 14px;
    --shadow-card: 0 1px 2px rgba(0, 0, 64, 0.06), 0 6px 20px rgba(0, 0, 64, 0.06);

    --font-display: 'Big Shoulders Display', sans-serif;
    --font-body: 'Work Sans', sans-serif;
    --font-mono: 'IBM Plex Mono', monospace;

    --container: 1180px;
}

/* ---------- bazice ---------- */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
    margin: 0;
    font-family: var(--font-body);
    color: var(--ink);
    background: var(--paper);
    font-size: 16px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

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

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

h1, h2, h3, h4 {
    font-family: var(--font-display);
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.01em;
    line-height: 0.98;
    margin: 0 0 0.4em;
}

p { margin: 0 0 1em; }

.container {
    width: 100%;
    max-width: var(--container);
    margin: 0 auto;
    padding: 0 20px;
}

/* focus vizibil peste tot, esential pentru accesibilitate cu tastatura */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 3px solid var(--coral);
    outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
    * { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
}

/* ---------- text utilitar / cifre ---------- */
.mono {
    font-family: var(--font-mono);
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.01em;
}

.eyebrow {
    font-family: var(--font-mono);
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--coral);
    font-weight: 600;
}

/* ============================================================
   NAVIGATIE
   ============================================================ */
.site-header {
    background: var(--ink);
    color: var(--white);
    position: sticky;
    top: 0;
    z-index: 50;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}

.nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 0;
    gap: 24px;
}

.logo {
    font-family: var(--font-display);
    font-weight: 800;
    font-size: 1.35rem;
    letter-spacing: 0.01em;
    color: var(--white);
    display: inline-flex;
    align-items: baseline;
    gap: 0.2em;
    white-space: nowrap;
}
.logo span { color: var(--coral); }

@media (max-width: 480px) {
    .logo { font-size: 1.1rem; }
}

.nav-links {
    display: flex;
    gap: 28px;
    list-style: none;
    margin: 0;
    padding: 0;
    font-weight: 500;
    font-size: 0.95rem;
}
.nav-links a { color: rgba(255,255,255,0.82); transition: color 0.15s ease; }
.nav-links a:hover { color: var(--white); }

.nav-actions { display: flex; align-items: center; gap: 10px; }

.nav-toggle {
    display: none;
    background: none;
    border: 0;
    color: var(--white);
    cursor: pointer;
    padding: 6px;
}

@media (max-width: 860px) {
    .nav-links { position: absolute; left: 0; right: 0; top: 100%; background: var(--ink); flex-direction: column; padding: 16px 20px; gap: 16px; border-top: 1px solid rgba(255,255,255,0.08); display: none; }
    .nav-links.open { display: flex; }
    .nav-toggle { display: inline-flex; }
    .nav-actions .btn { display: none; }
    .nav-actions.open-actions { display: flex; }
}

/* ============================================================
   BUTOANE
   ============================================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 0.92rem;
    padding: 11px 20px;
    border-radius: var(--radius-s);
    border: 1px solid transparent;
    cursor: pointer;
    transition: transform 0.12s ease, background-color 0.15s ease, border-color 0.15s ease;
}
.btn:active { transform: translateY(1px); }

.btn-coral { background: var(--coral); color: var(--white); }
.btn-coral:hover { background: var(--coral-dark); }

.btn-ghost { background: transparent; color: var(--white); border-color: rgba(255,255,255,0.35); }
.btn-ghost:hover { border-color: var(--white); }

.btn-outline { background: transparent; color: var(--ink); border-color: var(--ink); }
.btn-outline:hover { background: var(--ink); color: var(--white); }

.btn-block { width: 100%; }
.btn-sm { padding: 7px 14px; font-size: 0.85rem; }
.btn-danger { background: #fff; color: var(--piste-rosu); border-color: var(--piste-rosu); }
.btn-danger:hover { background: var(--piste-rosu); color: var(--white); }

/* ============================================================
   HERO + creasta muntoasa (elementul de semnatura)
   ============================================================ */
.hero {
    background: linear-gradient(180deg, var(--ink) 0%, #100a4d 100%);
    color: var(--white);
    padding: 64px 0 0;
    position: relative;
    overflow: hidden;
}

.hero-glow {
    position: absolute;
    inset: 0;
    background: radial-gradient(60% 50% at 80% 0%, rgba(248,168,128,0.25), transparent 70%),
                radial-gradient(50% 40% at 15% 10%, rgba(248,128,56,0.16), transparent 70%);
    pointer-events: none;
}

.hero-inner { position: relative; z-index: 1; text-align: left; max-width: 720px; }

.hero .eyebrow { color: var(--salmon); }

.hero h1 {
    font-size: clamp(2.4rem, 6vw, 4.6rem);
    margin-bottom: 0.3em;
}
.hero h1 em { font-style: normal; color: var(--coral); }

.hero-lead {
    font-size: 1.1rem;
    color: rgba(255,255,255,0.78);
    max-width: 560px;
}

.hero-search {
    display: flex;
    gap: 10px;
    margin: 28px 0 8px;
    max-width: 520px;
    flex-wrap: wrap;
}
.hero-search input {
    flex: 1;
    min-width: 220px;
    padding: 13px 16px;
    border-radius: var(--radius-s);
    border: 1px solid rgba(255,255,255,0.25);
    background: rgba(255,255,255,0.06);
    color: var(--white);
    font-family: var(--font-body);
    font-size: 0.95rem;
}
.hero-search input::placeholder { color: rgba(255,255,255,0.5); }

.hero-ticker {
    display: flex;
    gap: 28px;
    flex-wrap: wrap;
    margin-top: 36px;
    padding-top: 22px;
    border-top: 1px solid rgba(255,255,255,0.14);
}
.hero-ticker .stat-num {
    font-family: var(--font-mono);
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--salmon);
    display: block;
}
.hero-ticker .stat-label {
    font-size: 0.78rem;
    color: rgba(255,255,255,0.6);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.hero-mountains {
    width: 100%;
    height: 420px;
    margin-top: 30px;
    background-image: url('/assets/img/creasta-munti.webp');
    background-repeat: no-repeat;
    background-position: bottom center;
    background-size: cover;
}

@media (max-width: 760px) {
    .hero-mountains {
        height: 230px;
        margin-top: 30px;
        background-position: bottom left;
        background-image: url('/assets/img/creasta-munti-mobil.webp');
    }
}

/* ============================================================
   FILTRE
   ============================================================ */
.filter-bar {
    background: var(--white);
    border-bottom: 1px solid var(--line);
    padding: 16px 0;
    position: sticky;
    top: 65px;
    z-index: 30;
}
.filter-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.chip {
    font-family: var(--font-body);
    font-size: 0.85rem;
    font-weight: 600;
    padding: 8px 16px;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: var(--paper);
    color: var(--ink-70);
    cursor: pointer;
}
.chip[aria-pressed="true"] { background: var(--ink); color: var(--white); border-color: var(--ink); }

/* ============================================================
   CARDURI STATIUNE
   ============================================================ */
.section { padding: 48px 0; }
.section-head { display: flex; justify-content: space-between; align-items: end; gap: 20px; margin-bottom: 24px; flex-wrap: wrap; }
.section-head h2 { font-size: 2rem; margin: 0; }

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

.card {
    background: var(--white);
    border: 1px solid var(--line);
    border-radius: var(--radius-l);
    padding: 22px;
    box-shadow: var(--shadow-card);
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.card-top { display: flex; justify-content: space-between; align-items: start; gap: 10px; }
.card-top h3 { font-size: 1.5rem; margin: 0; }
.card-county { font-size: 0.82rem; color: var(--ink-40); text-transform: uppercase; letter-spacing: 0.04em; }

.pill {
    font-family: var(--font-body);
    font-size: 0.76rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 5px 11px;
    border-radius: 999px;
    white-space: nowrap;
}
.pill-open { background: var(--coral); color: var(--white); }
.pill-closed { background: var(--paper); color: var(--ink-40); border: 1px solid var(--line); }

.card-stats { display: flex; gap: 18px; flex-wrap: wrap; padding-top: 8px; border-top: 1px solid var(--line); }
.card-stats .stat-num { font-family: var(--font-mono); font-weight: 600; font-size: 1.05rem; }
.card-stats .stat-label { font-size: 0.72rem; color: var(--ink-40); text-transform: uppercase; letter-spacing: 0.04em; }

.piste-markers { display: flex; gap: 6px; }
.piste-marker { width: 16px; height: 16px; flex-shrink: 0; }
.piste-marker.verde { background: var(--piste-verde); border-radius: 50%; }
.piste-marker.albastru { background: var(--piste-albastru); }
.piste-marker.rosu { background: var(--piste-rosu); transform: rotate(45deg); }
.piste-marker.negru { background: var(--piste-negru); transform: rotate(45deg); }

/* ============================================================
   FORMULARE
   ============================================================ */
.auth-shell {
    min-height: calc(100vh - 65px);
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--ink);
    padding: 40px 20px;
}
.auth-card {
    background: var(--white);
    border-radius: var(--radius-l);
    padding: 40px 36px;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.35);
}
.auth-card h1 { font-size: 2rem; margin-bottom: 4px; }
.auth-sub { color: var(--ink-40); margin-bottom: 24px; font-size: 0.92rem; }

.field { margin-bottom: 18px; }
.field label { display: block; font-size: 0.85rem; font-weight: 600; margin-bottom: 6px; }
.field input, .field select, .field textarea {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid var(--line);
    border-radius: var(--radius-s);
    font-family: var(--font-body);
    font-size: 0.95rem;
    background: var(--paper);
    color: var(--ink);
}
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--coral); background: var(--white); }
.field-hint { font-size: 0.78rem; color: var(--ink-40); margin-top: 5px; }

.form-error {
    background: #fdecea;
    color: #b42318;
    border: 1px solid #f5c2c0;
    padding: 12px 14px;
    border-radius: var(--radius-s);
    font-size: 0.88rem;
    margin-bottom: 18px;
}
.form-success {
    background: #eaf7ed;
    color: #1e6b34;
    border: 1px solid #bfe6c8;
    padding: 12px 14px;
    border-radius: var(--radius-s);
    font-size: 0.88rem;
    margin-bottom: 18px;
}

.auth-links { display: flex; justify-content: space-between; font-size: 0.85rem; margin-top: 16px; }
.auth-links a { color: var(--coral); font-weight: 600; }

/* ============================================================
   LAYOUT CONT / ADMIN CU MENIU LATERAL
   ============================================================ */
.app-shell { display: flex; min-height: calc(100vh - 65px); }

.app-side {
    width: 240px;
    flex-shrink: 0;
    background: var(--ink);
    color: var(--white);
    padding: 26px 18px;
}
.app-side .side-title { font-family: var(--font-mono); font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.1em; color: rgba(255,255,255,0.45); margin: 22px 0 8px; padding: 0 10px; }
.app-side .side-title:first-child { margin-top: 0; }

.side-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 10px;
    border-radius: var(--radius-s);
    color: rgba(255,255,255,0.78);
    font-size: 0.92rem;
    font-weight: 500;
}
.side-link svg { width: 18px; height: 18px; flex-shrink: 0; }
.side-link:hover { background: rgba(255,255,255,0.06); color: var(--white); }
.side-link.active { background: var(--coral); color: var(--white); }

.app-main { flex: 1; padding: 32px; min-width: 0; }
.app-main-header { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 28px; flex-wrap: wrap; }
.app-main-header h1 { font-size: 2rem; margin: 0; }

@media (max-width: 860px) {
    .app-shell { flex-direction: column; }
    .app-side { width: 100%; display: flex; overflow-x: auto; gap: 6px; padding: 12px; }
    .app-side .side-title { display: none; }
    .side-link { white-space: nowrap; }
    .app-main { padding: 20px; }
}

/* ---------- carduri de statistica (admin) ---------- */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; margin-bottom: 30px; }
.stat-card { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius-m); padding: 18px; }
.stat-card .stat-num { font-family: var(--font-mono); font-size: 2rem; font-weight: 600; color: var(--ink); display: block; }
.stat-card .stat-label { font-size: 0.8rem; color: var(--ink-40); text-transform: uppercase; letter-spacing: 0.04em; }

/* ---------- tabel ---------- */
.table-wrap { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius-m); overflow: hidden; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; min-width: 560px; }
th, td { text-align: left; padding: 13px 16px; font-size: 0.9rem; border-bottom: 1px solid var(--line); }
th { font-family: var(--font-mono); font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--ink-40); font-weight: 600; }
tr:last-child td { border-bottom: none; }
.table-actions { display: flex; gap: 8px; }

.role-badge { font-family: var(--font-mono); font-size: 0.72rem; padding: 3px 9px; border-radius: 4px; text-transform: uppercase; }
.role-admin { background: var(--ink); color: var(--white); }
.role-resort_admin { background: var(--salmon); color: var(--ink); }
.role-user { background: var(--line); color: var(--ink-70); }

/* ---------- panou pericol (golire cache etc) ---------- */
.danger-box { border: 1px dashed var(--piste-rosu); background: #fff8f7; border-radius: var(--radius-m); padding: 18px; display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }
.danger-box p { margin: 0; font-size: 0.88rem; color: var(--ink-70); }

/* ============================================================
   PAGINA DE ADMINISTRARE PARTIE
   ============================================================ */
.toggle-open {
    display: flex;
    border: 2px solid var(--ink);
    border-radius: 999px;
    overflow: hidden;
    width: fit-content;
}
.toggle-open input { position: absolute; opacity: 0; pointer-events: none; }
.toggle-open label {
    padding: 10px 26px;
    font-weight: 700;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    cursor: pointer;
    color: var(--ink-70);
}
.toggle-open input:checked + label.lbl-open { background: var(--coral); color: var(--white); }
.toggle-open input:checked + label.lbl-closed { background: var(--ink); color: var(--white); }

.chip-select { display: flex; gap: 8px; flex-wrap: wrap; }
.chip-radio input { position: absolute; opacity: 0; pointer-events: none; }
.chip-radio label {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 9px 15px;
    border: 1px solid var(--line);
    border-radius: var(--radius-s);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    color: var(--ink-70);
}
.chip-radio input:checked + label { border-color: var(--ink); background: var(--ink); color: var(--white); }

.panel { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius-m); padding: 22px; margin-bottom: 20px; }
.panel h2 { font-size: 1.3rem; margin-bottom: 4px; }
.panel-sub { font-size: 0.85rem; color: var(--ink-40); margin-bottom: 18px; }

.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
@media (max-width: 640px) { .two-col { grid-template-columns: 1fr; } }

.install-row { display: flex; align-items: center; justify-content: space-between; padding: 11px 0; border-bottom: 1px solid var(--line); }
.install-row:last-child { border-bottom: none; }
.install-row .name { font-weight: 600; font-size: 0.9rem; display: flex; align-items: center; gap: 8px; }
.install-row select { width: auto; padding: 7px 10px; font-size: 0.82rem; }

/* ============================================================
   FOOTER
   ============================================================ */
.site-footer { background: var(--ink); color: rgba(255,255,255,0.7); padding: 40px 0 26px; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 30px; margin-bottom: 30px; }
.footer-grid h4 { color: var(--white); font-size: 1rem; margin-bottom: 12px; text-transform: none; font-family: var(--font-body); font-weight: 700; }
.footer-grid ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; font-size: 0.88rem; }
.footer-grid a:hover { color: var(--white); }
.footer-bottom { border-top: 1px solid rgba(255,255,255,0.12); padding-top: 18px; font-size: 0.8rem; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px; }
@media (max-width: 700px) { .footer-grid { grid-template-columns: 1fr; } }

/* ---------- utilitare vizuale ---------- */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.skip-link { position: absolute; left: -9999px; top: 0; background: var(--coral); color: var(--white); padding: 10px 16px; z-index: 100; font-weight: 600; }
.skip-link:focus { left: 10px; top: 10px; }
