/* XSD shared theme — mobile-first */
:root {
  --bg: #080c10;
  --bg-map-opacity: 0.06;
  --panel: #121820;
  --panel-2: #1a2330;
  --border: #2a3544;
  --text: #b8c4d0;
  --muted: #6b7a8a;
  --accent-amber: #c9a227;
  --accent-orange: #d4783a;
  --accent-blue: #4a8fd4;
  --brand-red: #c41e3a;
  --danger: #e85d5d;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
  --page-pad: max(16px, var(--safe-left));
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: "IBM Plex Sans", ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  background-color: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.5;
  padding:
    var(--safe-top)
    max(var(--page-pad), var(--safe-right))
    var(--safe-bottom)
    max(var(--page-pad), var(--safe-left));
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(ellipse 120% 80% at 50% 20%, rgba(74, 143, 212, 0.08), transparent 60%),
    var(--bg);
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  opacity: var(--bg-map-opacity);
  background-image: url("/shared/logos/map-bg.svg");
  background-size: cover;
  background-position: center;
  filter: blur(1px);
  pointer-events: none;
}

.device-phone body::after {
  opacity: 0.04;
}

@media (prefers-reduced-motion: reduce) {
  .typewriter::after { animation: none !important; }
  .card { animation: none !important; }
}

a {
  color: var(--accent-amber);
  text-decoration: none;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}

a:hover { color: var(--accent-orange); }

code, .mono {
  font-family: "IBM Plex Mono", ui-monospace, Consolas, monospace;
  font-size: 0.9em;
  color: var(--accent-blue);
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 0 20px;
  flex-wrap: wrap;
}

.site-header .brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.site-header img.logo {
  height: 40px;
  width: auto;
}

.device-phone .site-header img.logo {
  height: 32px;
}

.site-header h1 {
  margin: 0;
  font-size: clamp(1rem, 2.5vw, 1.15rem);
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--text);
}

.site-header .tag {
  font-family: "IBM Plex Mono", monospace;
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.container {
  width: 100%;
  max-width: 960px;
  margin: 0 auto;
}

.hero {
  text-align: center;
  margin-bottom: 28px;
}

.hero h2 {
  margin: 0 0 8px;
  font-size: clamp(1.35rem, 4vw, 1.85rem);
  font-weight: 600;
  color: #dde4ec;
}

.hero .typewriter {
  font-family: "IBM Plex Mono", monospace;
  font-size: clamp(0.8rem, 2.5vw, 0.95rem);
  color: var(--accent-amber);
  min-height: 1.5em;
  letter-spacing: 0.06em;
}

.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 16px;
  animation: fadeIn 0.5s ease both;
}

.card:nth-child(2) { animation-delay: 0.08s; }
.card:nth-child(3) { animation-delay: 0.16s; }

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

.card h3 {
  margin: 0 0 12px;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  font-weight: 600;
}

.card p { margin: 0 0 12px; color: var(--text); }
.muted { color: var(--muted); font-size: 14px; }

label {
  display: block;
  font-size: 13px;
  color: var(--muted);
  margin: 12px 0 6px;
}

input {
  width: 100%;
  padding: 12px 14px;
  min-height: 44px;
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-size: 16px;
}

input:focus {
  outline: 2px solid var(--accent-blue);
  outline-offset: 1px;
}

button, .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  min-width: 44px;
  padding: 10px 18px;
  border: 0;
  border-radius: 8px;
  font-size: 15px;
  cursor: pointer;
  background: var(--accent-blue);
  color: #fff;
  margin-top: 14px;
  text-decoration: none;
}

button.secondary, .btn.secondary {
  background: var(--panel-2);
  border: 1px solid var(--border);
  color: var(--text);
}

button.block, .btn.block {
  width: 100%;
}

button:hover, .btn:hover { opacity: 0.92; }

.banner {
  padding: 12px 14px;
  border-radius: 8px;
  margin-bottom: 16px;
  font-size: 14px;
  word-wrap: break-word;
}

.banner.error {
  background: rgba(200, 30, 58, 0.15);
  border: 1px solid var(--brand-red);
  color: #f0a0a8;
}

.hidden { display: none !important; }

.login-wrap {
  max-width: 420px;
  margin: 0 auto;
}

.grid-2 {
  display: grid;
  gap: 16px;
  grid-template-columns: 1fr;
}

@media (min-width: 640px) {
  .grid-2 { grid-template-columns: 1fr 1fr; }
  .login-wrap { padding: 0 8px; }
}

@media (min-width: 1024px) {
  .enroll-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
  }
}

.enroll-grid {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.enroll-card {
  order: 1;
}

.platform-ios .enroll-atak { order: 2; }
.platform-ios .enroll-itak { order: 1; }
.platform-android .enroll-atak { order: 1; }
.platform-android .enroll-itak { order: 2; }

.qr-wrap {
  text-align: center;
  margin: 12px 0;
}

.qr-wrap img {
  max-width: 100%;
  width: 280px;
  height: auto;
  border-radius: 8px;
  background: #fff;
  padding: 8px;
}

details summary {
  cursor: pointer;
  min-height: 44px;
  display: flex;
  align-items: center;
  color: var(--accent-amber);
  font-weight: 500;
}

.device-phone details .detail-body {
  font-size: 14px;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.header-actions button {
  margin-top: 0;
  padding: 8px 14px;
  font-size: 13px;
}

.footer-note {
  text-align: center;
  margin-top: 32px;
  font-size: 12px;
  color: var(--muted);
  font-family: "IBM Plex Mono", monospace;
}
