:root {
  --avx-primary: #0B3A5C;
  --avx-secondary: #1A6B9A;
  --avx-accent: #00A3A1;
  --avx-ink: #0F172A;
  --avx-muted: #64748B;
  --avx-surface: #F5F7FA;
  --avx-card: #FFFFFF;
  --avx-border: #E2E8F0;
  --avx-danger: #B42318;
  --avx-success: #027A48;
  --avx-radius: 12px;
  --avx-shadow: 0 12px 40px rgba(15, 23, 42, 0.08);
  --font-display: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  --font-body: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--avx-ink);
  background:
    radial-gradient(1200px 500px at 10% -10%, rgba(0, 163, 161, 0.12), transparent 60%),
    radial-gradient(900px 400px at 100% 0%, rgba(26, 107, 154, 0.14), transparent 55%),
    linear-gradient(180deg, #F8FAFC 0%, #EEF3F8 100%);
  min-height: 100vh;
}
a { color: var(--avx-secondary); text-decoration: none; }
a:hover { color: var(--avx-primary); }
img { max-width: 100%; height: auto; }

.container { width: min(1120px, calc(100% - 2rem)); margin-inline: auto; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  border: 0; border-radius: 10px; padding: .75rem 1.25rem; font-weight: 600;
  cursor: pointer; transition: transform .2s ease, box-shadow .2s ease, background .2s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn:disabled,
.btn[aria-disabled="true"] {
  opacity: .45;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
  pointer-events: none;
}
.btn-primary { background: var(--avx-primary); color: #fff; box-shadow: 0 8px 20px rgba(11,58,92,.25); }
.btn-primary:hover { background: #082c46; color: #fff; }
.btn-primary:disabled:hover,
.btn-primary[aria-disabled="true"]:hover { background: var(--avx-primary); }
.btn-secondary { background: #fff; color: var(--avx-primary); border: 1px solid var(--avx-border); }
.btn-accent { background: var(--avx-accent); color: #fff; }
.btn-block { width: 100%; }

.form-group { margin-bottom: 1rem; }
.form-group label { display: block; font-size: .9rem; font-weight: 600; margin-bottom: .4rem; }
.form-control {
  width: 100%; padding: .75rem .9rem; border: 1px solid var(--avx-border);
  border-radius: 10px; background: #fff; font: inherit; color: inherit;
}
.form-control:focus { outline: 2px solid rgba(0,163,161,.35); border-color: var(--avx-accent); }
.form-hint { font-size: .8rem; color: var(--avx-muted); margin-top: .35rem; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; }

.alert {
  padding: .9rem 1rem; border-radius: 10px; margin-bottom: 1rem; font-size: .95rem;
}
.alert-error { background: #FEF3F2; color: var(--avx-danger); border: 1px solid #FECDCA; }
.alert-success { background: #ECFDF3; color: var(--avx-success); border: 1px solid #A6F4C5; }
.alert-info { background: #EFF8FF; color: #175CD3; border: 1px solid #B2DDFF; }

.site-header {
  position: sticky; top: 0; z-index: 40;
  backdrop-filter: blur(10px);
  background: rgba(255,255,255,.82);
  border-bottom: 1px solid rgba(226,232,240,.8);
}
.site-header .inner {
  display: flex; align-items: center; justify-content: space-between;
  padding: 1rem 0; gap: 1rem;
}
.brand-logo, .brand-text { display: inline-flex; align-items: center; gap: .55rem; max-height: 40px; }
.brand-logo img, img.brand-logo { max-height: 40px; width: auto; }
.brand-text strong {
  display: inline-grid; place-items: center;
  width: 2.2rem; height: 2.2rem; border-radius: 8px;
  background: linear-gradient(135deg, var(--avx-primary), var(--avx-accent));
  color: #fff; font-size: .85rem;
}
.brand-text-full { font-weight: 700; color: var(--avx-primary); letter-spacing: -.02em; }
.nav-links { display: flex; gap: 1rem; align-items: center; flex-wrap: wrap; }
.nav-links a { color: var(--avx-ink); font-weight: 600; font-size: .95rem; }

.hero {
  min-height: calc(100vh - 74px);
  display: grid; align-items: end;
  padding: 4rem 0 5rem;
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: "";
  position: absolute; inset: 0;
  background:
    linear-gradient(120deg, rgba(11,58,92,.92), rgba(0,163,161,.55)),
    url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.06'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
  z-index: 0;
}
.hero-content { position: relative; z-index: 1; color: #fff; max-width: 720px; animation: rise .8s ease both; }
.hero-brand { font-size: clamp(2.4rem, 6vw, 4.2rem); font-weight: 800; letter-spacing: -.04em; margin: 0 0 .6rem; }
.hero-tagline { font-size: clamp(1.05rem, 2.4vw, 1.35rem); opacity: .92; margin: 0 0 1.5rem; max-width: 34ch; }
.hero-actions { display: flex; gap: .75rem; flex-wrap: wrap; }

.section { padding: 4rem 0; }
.section h2 { margin: 0 0 .5rem; font-size: clamp(1.6rem, 3vw, 2.1rem); }
.section p.lead { color: var(--avx-muted); margin-top: 0; max-width: 55ch; }

.site-footer {
  margin-top: 3rem; padding: 2rem 0;
  border-top: 1px solid var(--avx-border);
  color: var(--avx-muted); font-size: .9rem;
}

.auth-shell {
  min-height: 100vh; display: grid; place-items: center; padding: 2rem 1rem;
}
.auth-card {
  width: min(440px, 100%);
  background: rgba(255,255,255,.94);
  border: 1px solid var(--avx-border);
  border-radius: 18px;
  box-shadow: var(--avx-shadow);
  padding: 2rem;
  animation: rise .55s ease both;
}
.auth-card h1 { margin: .75rem 0 .35rem; font-size: 1.55rem; }
.auth-card .muted { color: var(--avx-muted); margin: 0 0 1.25rem; }

/* Installer */
.install-shell { min-height: 100vh; padding: 2rem 1rem 3rem; }
.install-wrap { width: min(920px, 100%); margin: 0 auto; }
.install-brand { text-align: center; margin-bottom: 1.5rem; animation: rise .5s ease both; }
.install-brand h1 { margin: .5rem 0 0; color: var(--avx-primary); font-size: clamp(1.8rem, 4vw, 2.4rem); }
.install-brand p { margin: .35rem 0 0; color: var(--avx-muted); }
.steps {
  display: flex; gap: .35rem; overflow-x: auto; margin-bottom: 1.25rem; padding-bottom: .25rem;
}
.step-pill {
  flex: 1; min-width: 96px; text-align: center; font-size: .75rem; font-weight: 700;
  padding: .55rem .4rem; border-radius: 999px; background: #fff; border: 1px solid var(--avx-border);
  color: var(--avx-muted);
}
.step-pill.active { background: var(--avx-primary); color: #fff; border-color: var(--avx-primary); }
.step-pill.done { background: #ECFDF3; color: var(--avx-success); border-color: #A6F4C5; }
.install-panel {
  background: rgba(255,255,255,.96); border: 1px solid var(--avx-border);
  border-radius: 18px; box-shadow: var(--avx-shadow); padding: 1.5rem;
  animation: rise .55s ease both;
}
.req-list { list-style: none; padding: 0; margin: 0; }
.req-list li {
  display: flex; justify-content: space-between; gap: 1rem; align-items: flex-start;
  padding: .85rem 0; border-bottom: 1px solid var(--avx-border);
}
.req-pass { color: var(--avx-success); font-weight: 700; }
.req-fail { color: var(--avx-danger); font-weight: 700; }
.req-fix { display: block; font-size: .8rem; color: var(--avx-muted); margin-top: .25rem; }
.branding-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 1rem; }
.branding-item {
  border: 1px dashed var(--avx-border); border-radius: 12px; padding: 1rem; text-align: center; background: #fff;
}
.branding-item img { max-height: 56px; margin-bottom: .5rem; }
.preview-box {
  min-height: 64px; display: grid; place-items: center; background: var(--avx-surface);
  border-radius: 8px; margin-bottom: .75rem;
}

/* Admin */
.admin-body { background: #F1F5F9; min-height: 100vh; }
.admin-layout { display: grid; grid-template-columns: 260px 1fr; min-height: 100vh; }
.admin-sidebar {
  background: linear-gradient(180deg, #0B3A5C 0%, #0A2F4A 100%);
  color: #fff; padding: 1.25rem 1rem; position: sticky; top: 0; height: 100vh;
}
.admin-sidebar .brand { margin-bottom: 1.5rem; }
.admin-sidebar .brand .brand-text-full,
.admin-sidebar a { color: #E2E8F0; }
.admin-nav { display: flex; flex-direction: column; gap: .35rem; }
.admin-nav a {
  padding: .7rem .85rem; border-radius: 10px; font-weight: 600; color: rgba(255,255,255,.85);
}
.admin-nav a:hover, .admin-nav a.active { background: rgba(255,255,255,.12); color: #fff; }
.admin-main { padding: 1.25rem 1.5rem 2rem; }
.admin-top {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 1.25rem; gap: 1rem; flex-wrap: wrap;
}
.admin-top h1 { margin: 0; font-size: 1.5rem; }
.stat-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 1rem;
}
.stat-card {
  background: #fff; border: 1px solid var(--avx-border); border-radius: 14px;
  padding: 1.1rem; box-shadow: 0 4px 16px rgba(15,23,42,.04);
  animation: rise .5s ease both;
}
.stat-card .label { color: var(--avx-muted); font-size: .85rem; font-weight: 600; }
.stat-card .value { font-size: 1.7rem; font-weight: 800; margin-top: .35rem; color: var(--avx-primary); }
.panel {
  background: #fff; border: 1px solid var(--avx-border); border-radius: 14px;
  padding: 1.25rem; margin-top: 1rem;
}
.panel h2 { margin: 0 0 1rem; font-size: 1.15rem; }

@keyframes rise {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 900px) {
  .admin-layout { grid-template-columns: 1fr; }
  .admin-sidebar { position: relative; height: auto; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .nav-links { display: none; }
}
