:root {
  color-scheme: dark;
  --bg: #000000;
  --surface: rgba(28, 28, 30, 0.65);
  --surface-strong: #1C1C1E;
  --text: #FFFFFF;
  --muted: #EBEBF599; /* iOS secondary label color */
  --accent: #0A84FF; /* iOS Blue */
  --accent-dark: #007AFF;
  --danger: #FF453A; /* iOS Red */
  --success: #32D74B; /* iOS Green */
  --border: rgba(255, 255, 255, 0.1);
  --shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  --font-stack: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Icons", "Helvetica Neue", Helvetica, Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: var(--font-stack);
  background: 
    radial-gradient(circle at top left, rgba(10, 132, 255, 0.15), transparent 40%),
    var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
}

.page {
  width: min(1000px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 40px 0 80px;
}

.hero,
.panel,
.split,
.card,
.overlay-card {
  background: var(--surface);
  backdrop-filter: blur(25px);
  -webkit-backdrop-filter: blur(25px);
  border: 1px solid var(--border);
  border-radius: 20px;
  box-shadow: var(--shadow);
  transition: transform 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.hero {
  padding: 48px 32px;
  margin-bottom: 24px;
  text-align: center;
}

.panel {
  padding: 24px;
  margin-bottom: 24px;
}

.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  padding: 24px;
}

.stack {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.card {
  padding: 24px;
}

h1, h2, h3, p {
  margin-top: 0;
}

h1 {
  font-size: 2.2rem;
  font-weight: 700;
  letter-spacing: -0.04em;
  margin-bottom: 12px;
}

h2 {
  font-size: 1.3rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin-bottom: 20px;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-size: 12px;
  color: var(--accent);
  font-weight: 700;
  margin-bottom: 12px;
}

.muted {
  color: var(--muted);
  font-size: 15px;
}

.status {
  padding: 12px 16px;
  border-radius: 12px;
  background: rgba(10, 132, 255, 0.1);
  border: 1px solid rgba(10, 132, 255, 0.2);
  font-weight: 500;
  display: inline-block;
  font-size: 15px;
}

.status.error {
  color: #FF6961;
  background: rgba(255, 69, 58, 0.1);
  border-color: rgba(255, 69, 58, 0.2);
}

.status.success {
  color: #30D158;
  background: rgba(50, 215, 75, 0.1);
  border-color: rgba(50, 215, 75, 0.2);
}

label {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 14px;
  font-weight: 500;
  color: rgba(235, 235, 245, 0.6);
}

input, select, textarea {
  width: 100%;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  padding: 12px 16px;
  font: inherit;
  font-size: 16px; /* Prevents iOS zoom */
  background: rgba(118, 118, 128, 0.24); /* iOS text field background */
  color: var(--text);
  transition: all 0.2s ease;
}

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--accent);
  background: rgba(118, 118, 128, 0.3);
}

button {
  background: var(--accent);
  color: #FFFFFF;
  border: none;
  border-radius: 14px;
  padding: 14px 20px;
  font: inherit;
  font-weight: 600;
  font-size: 16px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.25, 0.8, 0.25, 1);
  width: 100%;
}

button:hover:not(:disabled) {
  background: var(--accent-dark);
  transform: scale(0.98);
}

button:active:not(:disabled) {
  transform: scale(0.96);
  opacity: 0.8;
}

button.secondary {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text);
}

button.secondary:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.15);
}

button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* Password wrapper for show/hide */
.password-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.password-wrapper input {
  padding-right: 80px; /* Make room for the button */
}

.password-toggle {
  position: absolute;
  right: 8px;
  background: transparent;
  border: none;
  color: var(--accent);
  font-size: 14px;
  font-weight: 600;
  width: auto;
  padding: 8px 12px;
  border-radius: 8px;
}

.password-toggle:hover {
  background: rgba(10, 132, 255, 0.1);
  transform: none;
}

.grid-2,
.grid-3 {
  display: grid;
  gap: 16px;
}

.grid-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grid-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.1);
  color: var(--text);
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 14px;
  font-weight: 600;
}

video, canvas, #map {
  width: 100%;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: #000;
}

video {
  min-height: 320px;
  object-fit: cover;
}

canvas {
  display: none;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 15px;
}

th, td {
  text-align: left;
  padding: 14px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

th {
  font-weight: 500;
  color: rgba(235, 235, 245, 0.6);
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

tr:last-child td {
  border-bottom: none;
}

.overlay {
  position: fixed;
  inset: 0;
  display: none;
  place-items: center;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  z-index: 1000;
}

.overlay.visible {
  display: grid;
  animation: fadeIn 0.25s ease-out;
}

.overlay-card {
  padding: 40px;
  text-align: center;
  max-width: 420px;
  animation: scaleUp 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes scaleUp {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

.hidden {
  display: none !important;
}

@media (max-width: 900px) {
  .split,
  .grid-2,
  .grid-3 {
    grid-template-columns: 1fr;
  }

  .page {
    width: 100%;
    padding: 24px 16px 64px;
  }
}
