/* =========================================================
   Controlstech - Modern Technological Theme
   Palette derived from the Controlstech logo (navy + blue),
   paired with a bright cyan "signal" glow accent.
   ========================================================= */

:root {
  --bg: #060c1a;
  --bg-soft: #0a1426;
  --panel: rgba(19, 30, 56, 0.72);
  --panel-solid: #101c38;
  --panel-2: rgba(27, 42, 76, 0.75);
  --border: #1e2f52;
  --border-light: #33507f;
  --text: #eef2fc;
  --text-muted: #9db0d6;
  --text-dim: #64749c;

  /* logo blues */
  --brand-dark: #24396f;
  --brand: #334e95;
  --brand-light: #6f8fd9;

  /* bright technological "signal" accent, derived from the brand hue */
  --glow: #3fd4ff;
  --glow-soft: #7de3ff;

  --accent: var(--glow);
  --accent-hover: var(--glow-soft);
  --accent-contrast: #04121e;

  --danger: #f87171;
  --success: #34d399;
  --radius: 14px;
  --container: 1180px;
  --shadow: 0 20px 50px rgba(2, 6, 16, 0.55);
  --glow-shadow: 0 0 0 1px rgba(63, 212, 255, 0.15), 0 0 30px rgba(51, 78, 149, 0.35);
  --font-head: "Space Grotesk", "Inter", sans-serif;
  --font-body: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

/* Layered tech backdrop: soft brand-color glows + a fine circuit/grid mesh */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(circle at 12% -5%, rgba(63, 212, 255, 0.10), transparent 42%),
    radial-gradient(circle at 88% 10%, rgba(51, 78, 149, 0.28), transparent 45%),
    radial-gradient(circle at 50% 100%, rgba(36, 57, 111, 0.35), transparent 55%),
    var(--bg);
}
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  opacity: 0.5;
  background-image:
    linear-gradient(rgba(63, 212, 255, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(63, 212, 255, 0.05) 1px, transparent 1px);
  background-size: 46px 46px;
  mask-image: radial-gradient(ellipse 100% 60% at 50% 0%, black 0%, transparent 70%);
}

h1, h2, h3, h4 {
  font-family: var(--font-head);
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.15;
  color: #fff;
  margin: 0 0 0.5em;
}

h1 { font-size: clamp(2.3rem, 5vw, 3.6rem); }
h2 { font-size: clamp(1.6rem, 3.2vw, 2.2rem); }
h3 { font-size: 1.3rem; }

p { margin: 0 0 1em; color: var(--text-muted); }
a { color: var(--glow-soft); text-decoration: none; transition: color 0.15s ease; }
a:hover { color: #fff; }

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

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

.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--glow);
  color: var(--accent-contrast);
  padding: 10px 16px;
  z-index: 999;
  border-radius: 0 0 6px 0;
}
.skip-link:focus { left: 0; }

/* ---------------- Header / Nav ---------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(6, 12, 26, 0.78);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 80px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: #fff;
  font-family: var(--font-head);
  font-size: 1.3rem;
  font-weight: 700;
  letter-spacing: 0.01em;
}
.brand:hover { color: #fff; }
.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  filter: drop-shadow(0 0 10px rgba(63, 212, 255, 0.35));
}
.brand-mark img { height: 34px; width: auto; display: block; }

.primary-nav ul {
  list-style: none;
  display: flex;
  gap: 6px;
  margin: 0;
  padding: 0;
  align-items: center;
}

.primary-nav a {
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.95rem;
  padding: 10px 14px;
  border-radius: 8px;
  display: inline-block;
}

.primary-nav a:hover,
.primary-nav a.active {
  color: #fff;
  background: rgba(63, 212, 255, 0.08);
}

.primary-nav a.nav-cta {
  background: linear-gradient(135deg, var(--brand), var(--brand-dark));
  color: #fff !important;
  margin-left: 8px;
  box-shadow: 0 0 0 1px rgba(63,212,255,0.2), 0 4px 18px rgba(51,78,149,0.45);
}
.primary-nav a.nav-cta:hover { background: linear-gradient(135deg, var(--brand-light), var(--brand)); }

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  background: transparent;
  border: 1px solid var(--border-light);
  border-radius: 8px;
  cursor: pointer;
}
.nav-toggle span {
  display: block;
  height: 2px;
  width: 20px;
  margin: 0 auto;
  background: #fff;
}

/* ---------------- Buttons ---------------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 0.92rem;
  padding: 15px 30px;
  border-radius: 9px;
  border: 1px solid transparent;
  cursor: pointer;
  letter-spacing: 0.01em;
  font-family: var(--font-head);
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}
.btn-primary {
  background: linear-gradient(135deg, var(--brand-light), var(--brand) 55%, var(--brand-dark));
  color: #fff;
  box-shadow: 0 0 0 1px rgba(63,212,255,0.25), 0 8px 26px rgba(51,78,149,0.5);
}
.btn-primary:hover {
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 0 0 1px rgba(63,212,255,0.4), 0 10px 32px rgba(63,212,255,0.25);
}
.btn-outline {
  background: rgba(255,255,255,0.02);
  border-color: var(--border-light);
  color: #fff;
}
.btn-outline:hover { border-color: var(--glow); color: var(--glow-soft); box-shadow: 0 0 20px rgba(63,212,255,0.15); }
.btn-block { width: 100%; justify-content: center; }
.btn[disabled] { opacity: 0.5; cursor: not-allowed; transform: none !important; box-shadow: none !important; }

/* ---------------- Hero ---------------- */
.hero {
  position: relative;
  padding: 100px 0 76px;
  overflow: hidden;
  border-bottom: 1px solid var(--border);
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 48px;
  align-items: center;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--glow-soft);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.78rem;
  margin-bottom: 18px;
}
.eyebrow::before {
  content: "";
  width: 26px;
  height: 2px;
  background: linear-gradient(90deg, var(--glow), transparent);
}

.hero p.lead {
  font-size: 1.15rem;
  color: var(--text-muted);
  max-width: 54ch;
}

.hero-actions { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 28px; }

.hero-figure {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow), var(--glow-shadow);
}

/* ---------------- Sections ---------------- */
section { padding: 82px 0; }
.section-alt { background: var(--bg-soft); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }

.section-head { max-width: 66ch; margin-bottom: 42px; }
.section-head.center { margin-left: auto; margin-right: auto; text-align: center; }

/* ---------------- Cards / grids ---------------- */
.grid {
  display: grid;
  gap: 24px;
}
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

.card {
  position: relative;
  background: var(--panel);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}
.card::before {
  content: "";
  position: absolute;
  top: -1px; left: -1px;
  width: 26px; height: 26px;
  border-top: 2px solid var(--glow);
  border-left: 2px solid var(--glow);
  border-radius: var(--radius) 0 0 0;
  opacity: 0;
  transition: opacity 0.2s ease;
}
.card:hover {
  transform: translateY(-4px);
  border-color: var(--border-light);
  box-shadow: 0 16px 40px rgba(2,6,16,0.45), 0 0 24px rgba(63,212,255,0.08);
}
.card:hover::before { opacity: 1; }

.card-icon {
  width: 46px;
  height: 46px;
  border-radius: 10px;
  background: rgba(63, 212, 255, 0.10);
  border: 1px solid rgba(63, 212, 255, 0.18);
  color: var(--glow-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 18px;
}
.card-icon svg { width: 24px; height: 24px; }

.card h3 { margin-bottom: 10px; }
.card p:last-child { margin-bottom: 0; }

.card ul {
  margin: 0;
  padding-left: 18px;
  color: var(--text-muted);
}
.card ul li { margin-bottom: 6px; }

/* list with check icons, no bullets */
.check-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 14px; }
.check-list li {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  color: var(--text-muted);
}
.check-list li strong { color: #fff; }
.check-icon {
  flex: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(63, 212, 255, 0.12);
  border: 1px solid rgba(63, 212, 255, 0.25);
  color: var(--glow-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 2px;
}
.check-icon svg { width: 13px; height: 13px; }

/* ---------------- Stat strip ---------------- */
.stat-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  padding: 40px 0;
}
.stat { text-align: center; }
.stat strong {
  display: block;
  font-family: var(--font-head);
  font-size: 2.2rem;
  background: linear-gradient(135deg, #fff, var(--glow-soft));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.stat span { color: var(--text-dim); font-size: 0.9rem; text-transform: uppercase; letter-spacing: 0.05em; }

/* ---------------- Service / project detail blocks ---------------- */
.service-block {
  display: grid;
  grid-template-columns: 60px 1fr;
  gap: 22px;
  padding: 30px 0;
  border-bottom: 1px solid var(--border);
}
.service-block:last-child { border-bottom: none; }
.service-num {
  font-family: var(--font-head);
  font-size: 1.6rem;
  background: linear-gradient(135deg, var(--glow-soft), var(--brand));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  opacity: 0.85;
}

.project-card {
  background: var(--panel);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}
.project-card:hover {
  border-color: var(--border-light);
  transform: translateY(-4px);
  box-shadow: 0 16px 40px rgba(2,6,16,0.45), 0 0 24px rgba(63,212,255,0.08);
}
.project-card figure { margin: 0; }
.project-card .project-body { padding: 24px; }
.project-tag {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--glow-soft);
  background: rgba(63, 212, 255, 0.10);
  border: 1px solid rgba(63, 212, 255, 0.2);
  padding: 4px 10px;
  border-radius: 20px;
  margin-bottom: 12px;
}

/* ---------------- CTA banner ---------------- */
.cta-banner {
  position: relative;
  background: linear-gradient(135deg, var(--panel-2), var(--panel));
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  padding: 52px;
  text-align: center;
  overflow: hidden;
  box-shadow: var(--glow-shadow);
}
.cta-banner::after {
  content: "";
  position: absolute;
  top: -60%; right: -20%;
  width: 60%; height: 220%;
  background: radial-gradient(circle, rgba(63,212,255,0.14), transparent 65%);
  pointer-events: none;
}
.cta-banner h2 { margin-bottom: 10px; }
.cta-banner p { max-width: 60ch; margin-left: auto; margin-right: auto; }

/* ---------------- Forms ---------------- */
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}
.form-field { display: flex; flex-direction: column; gap: 6px; }
.form-field.full { grid-column: 1 / -1; }
.form-field label { font-weight: 600; font-size: 0.9rem; color: #fff; }
.form-field .required { color: var(--glow); }

input, select, textarea {
  background: rgba(6, 12, 26, 0.55);
  border: 1px solid var(--border-light);
  color: var(--text);
  padding: 12px 14px;
  border-radius: 8px;
  font-family: var(--font-body);
  font-size: 0.95rem;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--glow);
  box-shadow: 0 0 0 3px rgba(63,212,255,0.15);
}
textarea { resize: vertical; min-height: 120px; }

/* honeypot field - hidden from real users, visible to bots that auto-fill forms */
.hp-field {
  position: absolute !important;
  left: -9999px !important;
  top: -9999px !important;
  height: 0;
  width: 0;
  overflow: hidden;
}

.form-note { font-size: 0.85rem; color: var(--text-dim); }

.alert {
  padding: 16px 18px;
  border-radius: 10px;
  margin-bottom: 24px;
  font-weight: 500;
}
.alert-success { background: rgba(52,211,153,0.12); border: 1px solid rgba(52,211,153,0.4); color: var(--success); }
.alert-error { background: rgba(248,113,113,0.12); border: 1px solid rgba(248,113,113,0.4); color: var(--danger); }

.contact-info-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 18px; }
.contact-info-list li { display: flex; gap: 14px; align-items: flex-start; }
.contact-info-list .card-icon { margin-bottom: 0; }

/* ---------------- Footer ---------------- */
.site-footer {
  border-top: 1px solid var(--border);
  background: var(--bg-soft);
  padding-top: 48px;
}
.footer-inner {
  display: grid;
  grid-template-columns: 1.2fr 1.4fr 1.2fr;
  gap: 28px;
  padding-bottom: 32px;
  border-bottom: 1px solid var(--border);
}
.footer-brand { display: flex; gap: 12px; align-items: center; }
.footer-brand .brand-mark img { height: 30px; }
.footer-name { color: #fff; font-weight: 700; margin: 0; font-family: var(--font-head); }
.footer-tagline { margin: 0; color: var(--text-dim); font-size: 0.85rem; }
.footer-nav { display: flex; flex-wrap: wrap; gap: 4px 18px; align-content: center; }
.footer-nav a { color: var(--text-muted); font-size: 0.9rem; }
.footer-contact { display: flex; flex-direction: column; gap: 6px; font-size: 0.9rem; }
.footer-contact a, .footer-contact span { color: var(--text-muted); }
.footer-bottom { padding: 18px 0 28px; color: var(--text-dim); font-size: 0.82rem; }

/* ---------------- Placeholder image marker ---------------- */
.placeholder-note {
  font-size: 0.75rem;
  color: var(--text-dim);
  text-align: center;
  margin-top: 8px;
}

/* ---------------- Responsive ---------------- */
@media (max-width: 960px) {
  .hero-grid { grid-template-columns: 1fr; }
  .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .stat-strip { grid-template-columns: repeat(2, 1fr); }
  .footer-inner { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
  .nav-toggle { display: flex; }
  .primary-nav {
    position: absolute;
    top: 80px;
    left: 0;
    right: 0;
    background: rgba(6,12,26,0.97);
    backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--border);
    display: none;
  }
  .primary-nav.open { display: block; }
  .primary-nav ul { flex-direction: column; align-items: stretch; padding: 12px 24px 20px; }
  .primary-nav a.nav-cta { margin-left: 0; text-align: center; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .service-block { grid-template-columns: 1fr; }
  .cta-banner { padding: 32px 22px; }
}

/* =========================================================
   Admin CMS
   ========================================================= */
.admin-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
  padding: 20px 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 24px;
}
.admin-nav { display: flex; flex-wrap: wrap; gap: 6px; }
.admin-nav a {
  padding: 8px 16px;
  border-radius: 8px;
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.92rem;
}
.admin-nav a:hover { color: var(--text); background: var(--panel-2); }
.admin-nav a.active { color: var(--accent-contrast); background: var(--accent); }

.admin-section { margin-bottom: 32px; }
.admin-section h2 { margin-bottom: 4px; }
.admin-section-note { color: var(--text-dim); font-size: 0.9rem; margin-top: 0; margin-bottom: 20px; }

.field-group {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 20px;
}
.field-group.single { grid-template-columns: 1fr; }
@media (max-width: 720px) { .field-group { grid-template-columns: 1fr; } }

.secret-field { position: relative; }
.secret-field input { padding-right: 90px; width: 100%; }
.secret-toggle {
  position: absolute;
  right: 8px;
  top: 8px;
  background: var(--panel-2);
  border: 1px solid var(--border-light);
  color: var(--text-muted);
  padding: 5px 10px;
  border-radius: 6px;
  font-size: 0.75rem;
  cursor: pointer;
}
.secret-toggle:hover { color: var(--text); border-color: var(--glow); }

.btn-sm { padding: 8px 16px; font-size: 0.85rem; }

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
}
.status-pill.ok { background: rgba(52,211,153,0.14); color: var(--success); }
.status-pill.bad { background: rgba(248,113,113,0.14); color: var(--danger); }
.status-pill.warn { background: rgba(251,191,36,0.14); color: #fbbf24; }

.photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 20px;
}
.photo-slot { padding: 16px; }
.photo-slot h4 { margin: 0 0 10px; font-size: 0.95rem; color: #fff; }
.photo-slot .photo-preview {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--border-light);
  background: var(--bg-soft);
  margin-bottom: 10px;
}
.photo-slot .photo-meta { font-size: 0.78rem; color: var(--text-dim); margin: 6px 0 10px; }
.photo-slot input[type="file"] {
  width: 100%;
  font-size: 0.82rem;
  padding: 8px;
}

.content-group { border-top: 1px solid var(--border); padding-top: 20px; margin-top: 20px; }
.content-group:first-child { border-top: none; padding-top: 0; margin-top: 0; }
.content-group summary {
  cursor: pointer;
  font-family: var(--font-head);
  font-weight: 700;
  color: #fff;
  font-size: 1.05rem;
  padding: 6px 0;
  list-style: none;
}
.content-group summary::-webkit-details-marker { display: none; }
.content-group summary::before { content: '▸ '; color: var(--glow); }
.content-group[open] summary::before { content: '▾ '; }
.content-group .field-group { margin-top: 16px; }

.field-field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.field-field label { font-weight: 600; font-size: 0.85rem; color: var(--text-muted); }
.field-field textarea { min-height: 90px; }
.field-hint { font-size: 0.78rem; color: var(--text-dim); margin: 0; }
