/* ═══════════════════════════════════════════════════════
   CYLVERN SECURITY — MAIN SITE
   Design tokens match CTF palette; supports dark/light mode
═══════════════════════════════════════════════════════ */

/* ── Tokens ─────────────────────────────────────────── */
:root {
    --purple: #7c4dff;
    --purple-dim: #5a2dca;
    --blue: #4d7cff;
    --green: #00e676;
    --warn: #ffab40;
    --danger: #ff5252;
    --radius: 14px;
    --transition: .22s ease;

    /* dark theme (default) */
    --bg: #060608;
    --surface: rgba(18, 18, 26, .88);
    --surface-solid: #12121a;
    --border: rgba(124, 77, 255, .26);
    --border-soft: rgba(255, 255, 255, .08);
    --text: #e8e8f0;
    --muted: #8888aa;
    --nav-bg: rgba(6, 6, 8, .78);
    --glass: rgba(20, 20, 28, .82);

    /* aliases used by the admin panel templates */
    --text-muted: var(--muted);
    --card-bg: var(--surface-solid);
    --radius-sm: 10px;
}

[data-theme="light"] {
    --bg: #f4f4f8;
    --surface: rgba(255, 255, 255, .92);
    --surface-solid: #ffffff;
    --border: rgba(124, 77, 255, .3);
    --border-soft: rgba(0, 0, 0, .09);
    --text: #1a1a2e;
    --muted: #55557a;
    --nav-bg: rgba(244, 244, 248, .88);
    --glass: rgba(255, 255, 255, .82);
}

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

html { scroll-behavior: smooth; }

body {
    background: var(--bg);
    color: var(--text);
    font-family: 'Inter', 'Segoe UI', system-ui, sans-serif;
    font-size: 15px;
    line-height: 1.65;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    transition: background var(--transition), color var(--transition);
}

/* ── Background ──────────────────────────────────────── */
.bg-layer {
    position: fixed; inset: 0; z-index: -2;
    background:
        radial-gradient(ellipse 80% 40% at 50% 0%, rgba(124, 77, 255, .12), transparent),
        radial-gradient(ellipse 60% 35% at 80% 100%, rgba(77, 124, 255, .10), transparent),
        var(--bg);
}

.bg-grid {
    position: fixed; inset: 0; z-index: -1;
    background-image:
        linear-gradient(var(--border-soft) 1px, transparent 1px),
        linear-gradient(90deg, var(--border-soft) 1px, transparent 1px);
    background-size: 52px 52px;
    animation: gridDrift 24s linear infinite;
}
@keyframes gridDrift { to { transform: translateY(52px); } }

/* ── Alert Banner ────────────────────────────────────── */
.alert-bar {
    text-align: center;
    padding: 9px 20px;
    font-size: .88rem;
    font-weight: 500;
    position: relative;
}
.alert-bar-info    { background: rgba(77,124,255,.18); border-bottom: 1px solid rgba(77,124,255,.4); color: #a0b8ff; }
.alert-bar-warning { background: rgba(255,171,64,.18); border-bottom: 1px solid rgba(255,171,64,.4); color: #ffd180; }
.alert-bar-danger  { background: rgba(255,82,82,.18);  border-bottom: 1px solid rgba(255,82,82,.4);  color: #ff8a80; }
.alert-bar-success { background: rgba(0,230,118,.15);  border-bottom: 1px solid rgba(0,230,118,.3);  color: #69f0ae; }
.alert-bar i { margin-right: 7px; }

/* ── Nav ─────────────────────────────────────────────── */
nav {
    position: sticky; top: 0; z-index: 900;
    backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
    background: var(--nav-bg);
    border-bottom: 1px solid var(--border-soft);
    transition: background var(--transition);
}

.nav-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
    height: 62px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.nav-brand {
    display: flex; align-items: center; gap: 10px;
    text-decoration: none; flex-shrink: 0;
}
.nav-brand img { height: 34px; }
.nav-brand span {
    font-family: 'Orbitron', sans-serif;
    font-weight: 700; font-size: .95rem;
    background: linear-gradient(135deg, var(--purple), var(--blue));
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: 1px;
}

.nav-links {
    display: flex; align-items: center; gap: 6px;
    list-style: none;
}

.nav-links > li { position: relative; }

.nav-links a, .nav-links button.nav-link-btn {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 7px 13px; border-radius: 8px;
    color: var(--text); text-decoration: none; font-size: .9rem;
    background: none; border: none; cursor: pointer; font-family: inherit;
    transition: background var(--transition), color var(--transition);
    white-space: nowrap;
}
.nav-links a:hover, .nav-links button.nav-link-btn:hover {
    background: rgba(124, 77, 255, .1);
    color: var(--purple);
}
.nav-links a.active { color: var(--purple); }

/* Dropdown */
.nav-dropdown {
    position: absolute; top: calc(100% + 8px); left: 0;
    background: var(--surface-solid);
    border: 1px solid var(--border);
    border-radius: var(--radius); padding: 6px;
    min-width: 190px;
    box-shadow: 0 8px 32px rgba(0,0,0,.35);
    opacity: 0; pointer-events: none;
    transform: translateY(-6px);
    transition: opacity .18s ease, transform .18s ease;
    z-index: 100;
    list-style: none;
}
.nav-dropdown a {
    display: flex; align-items: center; gap: 9px;
    padding: 9px 12px; border-radius: 8px;
    font-size: .88rem; color: var(--text); text-decoration: none;
    transition: background var(--transition), color var(--transition);
}
.nav-dropdown a:hover { background: rgba(124,77,255,.1); color: var(--purple); }
.nav-dropdown .dd-icon { width: 22px; text-align: center; color: var(--purple); font-size: .85rem; }

.nav-links > li:hover .nav-dropdown,
.nav-links > li:focus-within .nav-dropdown {
    opacity: 1; pointer-events: auto; transform: translateY(0);
}

/* Nav right */
.nav-right { display: flex; align-items: center; gap: 8px; }

.theme-toggle {
    background: none; border: 1px solid var(--border-soft);
    border-radius: 8px; padding: 7px 10px;
    color: var(--muted); cursor: pointer; font-size: .9rem;
    transition: border-color var(--transition), color var(--transition), background var(--transition);
}
.theme-toggle:hover { border-color: var(--purple); color: var(--purple); background: rgba(124,77,255,.08); }

/* Hamburger (mobile) */
.nav-hamburger {
    display: none; background: none; border: 1px solid var(--border-soft);
    border-radius: 8px; padding: 8px 10px; cursor: pointer; color: var(--text); font-size: .95rem;
}

/* ── Layout ──────────────────────────────────────────── */
.container {
    width: 90%; max-width: 1100px;
    margin: 0 auto;
    flex: 1;
}

.section { padding: 80px 0; }
.section-sm { padding: 48px 0; }

.section-label {
    display: inline-flex; align-items: center; gap: 7px;
    background: rgba(124,77,255,.1); border: 1px solid rgba(124,77,255,.3);
    border-radius: 20px; padding: 4px 14px;
    font-size: .78rem; font-weight: 700; color: var(--purple);
    letter-spacing: .08em; text-transform: uppercase;
    margin-bottom: 16px;
}

.section-title {
    font-family: 'Orbitron', sans-serif;
    font-size: clamp(1.6rem, 3vw, 2.5rem);
    font-weight: 800; color: var(--text);
    margin-bottom: 16px; line-height: 1.2;
}

.section-subtitle {
    font-size: 1.05rem; color: var(--muted);
    max-width: 600px; margin-bottom: 48px; line-height: 1.7;
}

/* ── Card / Panel ────────────────────────────────────── */
.card {
    background: var(--glass);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius);
    padding: 28px;
    backdrop-filter: blur(10px);
    transition: border-color var(--transition), box-shadow var(--transition), transform var(--transition);
}
.card:hover {
    border-color: var(--border);
    box-shadow: 0 0 28px rgba(124,77,255,.14);
    transform: translateY(-3px);
}
.card-icon {
    width: 48px; height: 48px;
    background: rgba(124,77,255,.12);
    border: 1px solid rgba(124,77,255,.25);
    border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.2rem; color: var(--purple);
    margin-bottom: 18px;
}
.card-title { font-size: 1.05rem; font-weight: 700; color: var(--text); margin-bottom: 8px; }
.card-body { color: var(--muted); font-size: .9rem; line-height: 1.7; }

.panel {
    background: var(--glass);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 28px;
    backdrop-filter: blur(10px);
}

/* ── Buttons ─────────────────────────────────────────── */
.btn {
    display: inline-flex; align-items: center; gap: 7px;
    padding: .68rem 1.7rem; border-radius: 30px;
    font-weight: 600; font-size: .9rem;
    text-decoration: none; transition: all var(--transition);
    border: 2px solid transparent; cursor: pointer;
    white-space: nowrap; font-family: inherit;
}
.btn-primary { background: var(--purple); color: #fff; box-shadow: 0 0 20px rgba(124,77,255,.4); }
.btn-primary:hover { background: var(--purple-dim); box-shadow: 0 0 36px rgba(124,77,255,.7); transform: scale(1.04); color: #fff; }
.btn-outline { border-color: var(--purple); color: var(--purple); background: transparent; }
.btn-outline:hover { background: var(--purple); color: #fff; box-shadow: 0 0 24px rgba(124,77,255,.4); }
.btn-blue { background: var(--blue); color: #fff; box-shadow: 0 0 20px rgba(77,124,255,.35); }
.btn-blue:hover { filter: brightness(1.15); transform: scale(1.04); color: #fff; }
.btn-sm { padding: .45rem 1.1rem; font-size: .82rem; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { filter: brightness(1.15); color: #fff; }

/* ── Form ────────────────────────────────────────────── */
.form-group { margin-bottom: 20px; }
.form-group label { display: block; margin-bottom: 6px; font-size: .88rem; color: var(--muted); font-weight: 500; }
.form-control {
    width: 100%; padding: .72rem 1rem;
    background: rgba(0,0,0,.35); border: 1px solid var(--border-soft);
    border-radius: 8px; color: var(--text); font-size: .93rem;
    font-family: inherit; transition: border-color var(--transition), box-shadow var(--transition);
}
[data-theme="light"] .form-control { background: rgba(255,255,255,.8); border-color: rgba(0,0,0,.15); color: var(--text); }
.form-control:focus { outline: none; border-color: var(--purple); box-shadow: 0 0 14px rgba(124,77,255,.28); }
textarea.form-control { resize: vertical; min-height: 120px; }
select.form-control { appearance: none; cursor: pointer; }
.field-error { color: var(--danger); font-size: .82rem; margin-top: 4px; }

/* ── Flash messages ──────────────────────────────────── */
.flash-list { list-style: none; padding: 0; margin: 20px 0 0; }
.flash { padding: .78rem 1.1rem; border-radius: 8px; margin-bottom: 8px; font-size: .9rem; }
.flash-success { background: rgba(0,230,118,.12); border: 1px solid rgba(0,230,118,.35); color: #69f0ae; }
.flash-danger  { background: rgba(255,82,82,.12);  border: 1px solid rgba(255,82,82,.35);  color: #ff8a80; }
.flash-warning { background: rgba(255,171,64,.12); border: 1px solid rgba(255,171,64,.35); color: #ffd180; }
.flash-info    { background: rgba(77,124,255,.12); border: 1px solid rgba(77,124,255,.35); color: #a0b8ff; }

/* ── Hero ────────────────────────────────────────────── */
.hero {
    padding: 110px 0 90px;
    text-align: center;
    position: relative;
}
.hero-eyebrow { margin-bottom: 20px; }
.hero-title {
    font-family: 'Orbitron', sans-serif;
    font-size: clamp(2.2rem, 6vw, 4.2rem);
    font-weight: 900; line-height: 1.1;
    color: var(--text);
    margin-bottom: 22px;
}
.hero-title span {
    background: linear-gradient(135deg, var(--purple), var(--blue));
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
    background-clip: text;
}
.hero-subtitle { font-size: 1.15rem; color: var(--muted); max-width: 560px; margin: 0 auto 36px; }
.hero-actions { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }

/* ── Grid layouts ────────────────────────────────────── */
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 24px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.grid-auto { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 22px; }

/* ── Stat counter ────────────────────────────────────── */
.stat-box {
    text-align: center;
    padding: 24px 16px;
    background: var(--glass);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius);
}
.stat-number {
    font-family: 'Orbitron', sans-serif;
    font-size: clamp(1.8rem, 4vw, 2.8rem);
    font-weight: 800; color: var(--purple);
    display: block; line-height: 1.1; margin-bottom: 4px;
}
.stat-label { color: var(--muted); font-size: .85rem; }

/* ── Badge / chip ────────────────────────────────────── */
.badge {
    display: inline-flex; align-items: center; gap: 5px;
    background: rgba(124,77,255,.12);
    border: 1px solid rgba(124,77,255,.28);
    border-radius: 20px; padding: 3px 11px;
    font-size: .75rem; font-weight: 700; color: var(--purple);
    text-transform: uppercase; letter-spacing: .06em;
}
.badge-blue { background: rgba(77,124,255,.12); border-color: rgba(77,124,255,.28); color: var(--blue); }
.badge-green { background: rgba(0,230,118,.1); border-color: rgba(0,230,118,.28); color: var(--green); }
.badge-warn { background: rgba(255,171,64,.1); border-color: rgba(255,171,64,.28); color: var(--warn); }

.logo {
    max-width: 40px;
}
/* ── Process timeline ────────────────────────────────── */
.timeline { display: flex; flex-direction: column; gap: 0; }
.timeline-item { display: flex; gap: 20px; padding-bottom: 32px; position: relative; }
.timeline-item:last-child { padding-bottom: 0; }
.timeline-track { display: flex; flex-direction: column; align-items: center; flex-shrink: 0; }
.timeline-dot {
    width: 40px; height: 40px;
    background: rgba(124,77,255,.15);
    border: 2px solid var(--purple);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: .85rem; color: var(--purple); font-weight: 700;
    flex-shrink: 0;
}
.timeline-line { flex: 1; width: 2px; background: var(--border-soft); margin-top: 4px; }
.timeline-item:last-child .timeline-line { display: none; }
.timeline-content { padding-top: 6px; }
.timeline-step-title { font-weight: 700; color: var(--text); margin-bottom: 4px; }
.timeline-step-desc { color: var(--muted); font-size: .9rem; }

/* ── Table ───────────────────────────────────────────── */
.data-table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.data-table th {
    text-align: left; padding: 10px 14px;
    border-bottom: 2px solid var(--border);
    color: var(--purple); font-size: .8rem; font-weight: 700;
    text-transform: uppercase; letter-spacing: .06em;
}
.data-table td {
    padding: 11px 14px;
    border-bottom: 1px solid var(--border-soft);
    color: var(--text);
}
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: rgba(124,77,255,.04); }

/* ── Auth card ───────────────────────────────────────── */
.auth-wrap { min-height: 70vh; display: flex; align-items: center; justify-content: center; padding: 40px 20px; }
.auth-card {
    width: 100%; max-width: 400px;
    background: var(--glass); border: 1px solid var(--border);
    border-radius: 20px; padding: 2.4rem;
    backdrop-filter: blur(14px);
    box-shadow: 0 0 40px rgba(124,77,255,.15);
}
.auth-card h1 {
    text-align: center; font-family: 'Orbitron', sans-serif;
    font-size: 1.5rem; margin-bottom: .4rem;
    background: linear-gradient(135deg, var(--purple), var(--blue));
    -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}
.auth-card .auth-sub { text-align: center; color: var(--muted); font-size: .9rem; margin-bottom: 1.8rem; }

/* ── Footer ──────────────────────────────────────────── */
footer {
    border-top: 1px solid var(--border-soft);
    padding: 48px 0 28px;
    margin-top: auto;
}
.footer-inner {
    max-width: 1100px; width: 90%; margin: 0 auto;
    display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 40px;
}
.footer-brand span {
    font-family: 'Orbitron', sans-serif; font-weight: 700; font-size: 1.05rem;
    background: linear-gradient(135deg, var(--purple), var(--blue));
    -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}
.footer-brand p { color: var(--muted); font-size: .88rem; margin-top: 10px; line-height: 1.7; }
.footer-col h4 { font-size: .85rem; font-weight: 700; color: var(--text); margin-bottom: 14px; text-transform: uppercase; letter-spacing: .05em; }
.footer-col ul { list-style: none; }
.footer-col ul li { margin-bottom: 9px; }
.footer-col ul li a { color: var(--muted); text-decoration: none; font-size: .88rem; transition: color var(--transition); }
.footer-col ul li a:hover { color: var(--purple); }
.footer-bottom { max-width: 1100px; width: 90%; margin: 28px auto 0; padding-top: 18px; border-top: 1px solid var(--border-soft); display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.footer-bottom p { color: var(--muted); font-size: .82rem; }
.socials { display: flex; gap: 10px; }
.socials a { width: 34px; height: 34px; border-radius: 8px; border: 1px solid var(--border-soft); display: flex; align-items: center; justify-content: center; color: var(--muted); text-decoration: none; font-size: .9rem; transition: border-color var(--transition), color var(--transition), background var(--transition); }
.socials a:hover { border-color: var(--purple); color: var(--purple); background: rgba(124,77,255,.1); }

/* ── Admin panel ─────────────────────────────────────── */
.admin-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; }
.admin-table-wrap { overflow-x: auto; }

.tag-active { color: var(--green); font-size: .8rem; font-weight: 700; }
.tag-inactive { color: var(--muted); font-size: .8rem; font-weight: 700; }
.tag-unread { color: var(--warn); font-size: .8rem; font-weight: 700; }

.alert-level-info    { color: #a0b8ff; }
.alert-level-warning { color: #ffd180; }
.alert-level-danger  { color: #ff8a80; }
.alert-level-success { color: #69f0ae; }

/* ── WIP page ────────────────────────────────────────── */
.wip-wrap { min-height: 65vh; display: flex; align-items: center; justify-content: center; text-align: center; padding: 60px 20px; }
.wip-icon { font-size: 3.5rem; color: rgba(124,77,255,.4); margin-bottom: 24px; display: block; }
.wip-title { font-family: 'Orbitron', sans-serif; font-size: clamp(1.4rem, 3vw, 2rem); color: var(--text); margin-bottom: 12px; }

/* ── Responsive ──────────────────────────────────────── */
@media (max-width: 900px) {
    .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); }
    .footer-inner { grid-template-columns: 1fr 1fr; }
    .footer-inner > :first-child { grid-column: 1 / -1; }
    .admin-grid { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
    .nav-links { display: none; }
    .nav-hamburger { display: flex; }
    .nav-links.open {
        display: flex; flex-direction: column;
        position: absolute; top: 62px; left: 0; right: 0;
        background: var(--surface-solid);
        border-bottom: 1px solid var(--border-soft);
        padding: 12px;
        z-index: 800;
    }
    .nav-dropdown { position: static; opacity: 1; pointer-events: auto; transform: none; box-shadow: none; border: none; padding: 0 0 0 16px; background: transparent; }
    .hero { padding: 72px 0 56px; }
    .grid-2 { grid-template-columns: 1fr; }
    .footer-inner { grid-template-columns: 1fr; gap: 28px; }
    .footer-bottom { flex-direction: column; text-align: center; }
}

@media (max-width: 480px) {
    .grid-3 { grid-template-columns: 1fr; }
    .hero-title { font-size: 2rem; }
}

/* ── Admin panel ─────────────────────────────────────── */
.admin-wrap { max-width: 1000px; margin: 0 auto; padding: 40px 24px 80px; }

.btn-ghost {
    background: transparent; border: 1px solid var(--border-soft); color: var(--text);
}
.btn-ghost:hover { border-color: var(--purple); color: var(--purple); }

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

/* Level selector (Alert Management) */
.level-select-row { display: flex; gap: 8px; }
.level-opt {
    flex: 1; padding: .6rem 1rem; border-radius: 8px; cursor: pointer;
    font-size: .85rem; font-weight: 600; font-family: inherit;
    background: rgba(0,0,0,.35); border: 1px solid var(--border-soft); color: var(--muted);
    transition: all var(--transition);
}
[data-theme="light"] .level-opt { background: rgba(255,255,255,.8); border-color: rgba(0,0,0,.15); }
.level-opt:hover { color: var(--text); }
.level-opt.info.active    { background: rgba(77,124,255,.18);  border-color: var(--blue);   color: #a0b8ff; }
.level-opt.warning.active { background: rgba(255,171,64,.18);  border-color: var(--warn);   color: #ffd180; }
.level-opt.danger.active  { background: rgba(255,82,82,.18);   border-color: var(--danger); color: #ff8a80; }

/* Business inquiries table */
.inquiry-table { width: 100%; border-collapse: collapse; }
.inquiry-table th {
    text-align: left; padding: 10px 14px; font-size: .72rem; font-weight: 700;
    text-transform: uppercase; letter-spacing: .06em; color: var(--muted);
    border-bottom: 1px solid var(--border-soft); white-space: nowrap;
}
.inquiry-table td {
    padding: 12px 14px; font-size: .86rem; color: var(--text);
    border-bottom: 1px solid var(--border-soft);
}
.inquiry-table tbody tr:hover { background: rgba(124,77,255,.06); }
.inquiry-table td.unread { font-weight: 700; }
.inquiry-table td.unread::before {
    content: ''; display: inline-block; width: 7px; height: 7px; border-radius: 50%;
    background: var(--danger); margin-right: 8px;
}
