/* Touch-first kiosk styling for the HMI station app. Reuses the theme.css
   tokens (theme.css must be loaded first) but lays out big tap targets. */

body.station-body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.station-header {
  height: 72px;
  flex: 0 0 72px;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 20px;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow-header);
}
.station-header img { height: 32px; }
.station-header .station-title { font-weight: 800; font-size: 1.1rem; }
.station-header .spacer { flex: 1; }

.station-main {
  flex: 1;
  padding: 20px;
  overflow-y: auto;
}

.tap-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
  margin-top: 16px;
}

.tap-button {
  background: var(--bg-surface);
  border: 2px solid var(--border);
  border-radius: 18px;
  padding: 26px 18px;
  font-size: 1.1rem;
  font-weight: 700;
  text-align: center;
  cursor: pointer;
  box-shadow: var(--shadow-card);
  transition: all .12s;
  min-height: 88px;
}
.tap-button:active { transform: scale(0.97); }
.tap-button.selected {
  border-color: var(--accent);
  background: var(--accent-soft, rgba(59,130,246,.15));
  color: var(--accent-ink, var(--accent));
}

.scan-target {
  width: 100%;
  max-width: 560px;
  margin: 24px auto;
  aspect-ratio: 1;
  border-radius: 20px;
  overflow: hidden;
  background: #000;
  position: relative;
  border: 3px dashed var(--border);
}
.scan-target video { width: 100%; height: 100%; object-fit: cover; }
.scan-target .scan-hint {
  position: absolute;
  bottom: 12px; left: 0; right: 0;
  text-align: center;
  color: #fff;
  font-size: 0.9rem;
  background: rgba(0,0,0,.5);
  padding: 8px;
}

.capture-section-title {
  font-size: 1.05rem;
  font-weight: 800;
  margin: 24px 0 12px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.capture-progress {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-3);
  background: var(--bg-surface-2);
  padding: 4px 12px;
  border-radius: 9999px;
}

.capture-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 14px;
}

.station-form-field {
  background: var(--bg-surface);
  border: 2px solid var(--border);
  border-radius: 14px;
  padding: 14px 16px;
  transition: border-color .15s, background .15s;
}
.station-form-field.filled {
  border-color: var(--status-ok-bg, var(--accent));
}
.station-form-field label {
  display: block;
  font-size: 0.88rem;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--text-2);
}
.station-form-field input {
  width: 100%;
  font-size: 1.3rem;
  padding: 14px;
  border-radius: 10px;
  border: 2px solid var(--border);
  background: var(--bg-page);
  color: var(--text-1);
}
.station-form-field input:focus {
  border-color: var(--accent);
  outline: none;
}

.station-submit-bar {
  position: sticky;
  bottom: 0;
  background: var(--bg-page);
  padding: 14px 0 6px;
  margin-top: 20px;
  border-top: 1px solid var(--border);
}

.station-big-btn {
  width: 100%;
  padding: 20px;
  font-size: 1.2rem;
  font-weight: 800;
  border-radius: 16px;
  border: none;
  cursor: pointer;
  margin-top: 12px;
}
.station-big-btn.primary { background: var(--accent); color: #fff; }
.station-big-btn.ghost { background: var(--bg-surface-2); color: var(--text-1); }

/* ---------- Voice fill button ---------- */

.voice-fab {
  position: fixed;
  right: 20px;
  bottom: 110px;
  width: 66px;
  height: 66px;
  border-radius: 9999px;
  border: none;
  background: var(--accent);
  color: #fff;
  box-shadow: 0 6px 20px rgba(16, 24, 40, .35);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 60;
  transition: background .15s, transform .1s;
}
.voice-fab svg { width: 28px; height: 28px; }
.voice-fab:active { transform: scale(0.95); }
.voice-fab.listening {
  background: var(--status-critical-bg, #dc2626);
  animation: voice-pulse 1.1s infinite;
}
.voice-fab.unsupported { display: none; }

@keyframes voice-pulse {
  0% { box-shadow: 0 0 0 0 rgba(220, 38, 38, .45); }
  70% { box-shadow: 0 0 0 16px rgba(220, 38, 38, 0); }
  100% { box-shadow: 0 0 0 0 rgba(220, 38, 38, 0); }
}

.voice-target-label {
  position: fixed;
  right: 20px;
  bottom: 182px;
  max-width: 240px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 8px 12px;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-2);
  box-shadow: var(--shadow-card);
  z-index: 60;
  display: none;
}
.voice-target-label.show { display: block; }

/* ---------- Downtime ---------- */

.downtime-banner {
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: var(--status-critical-bg, #dc2626);
  color: var(--status-critical-text, #fff);
  padding: 12px 20px;
  font-weight: 700;
}
.downtime-banner.show { display: flex; }

.downtime-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, .45);
  z-index: 110;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.downtime-overlay.show { display: flex; }
.downtime-sheet {
  background: var(--bg-page);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  padding: 24px;
  width: 100%;
  max-width: 480px;
  max-height: 85vh;
  overflow-y: auto;
}
.downtime-sheet .tap-button.selected {
  border-color: var(--status-critical-bg, #dc2626);
  background: var(--status-critical-bg, #dc2626);
  color: #fff;
}

/* ---------- PIN login ---------- */

.login-error {
  background: var(--status-critical-bg);
  color: var(--status-critical-text);
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 0.85rem;
  margin: 0 auto 14px;
  max-width: 360px;
  text-align: center;
  display: none;
}
.login-error.show { display: block; }

.pin-dots {
  display: flex;
  justify-content: center;
  gap: 14px;
  margin: 24px 0 28px;
}
.pin-dot {
  width: 18px;
  height: 18px;
  border-radius: 9999px;
  border: 2px solid var(--border);
  background: transparent;
  transition: background .1s, border-color .1s;
}
.pin-dot.filled { background: var(--accent); border-color: var(--accent); }

.pin-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  max-width: 360px;
  margin: 0 auto;
}
.pin-key {
  background: var(--bg-surface);
  border: 2px solid var(--border);
  border-radius: 18px;
  padding: 20px;
  font-size: 1.4rem;
  font-weight: 700;
  text-align: center;
  cursor: pointer;
  box-shadow: var(--shadow-card);
  transition: transform .08s;
}
.pin-key:active { transform: scale(0.96); }
.pin-key-muted { color: var(--text-3); font-size: 0.95rem; }

.offline-banner {
  background: var(--status-warning-bg);
  color: var(--status-warning-text);
  padding: 12px 16px;
  border-radius: 12px;
  font-weight: 700;
  margin-bottom: 16px;
  display: none;
}
.offline-banner.show { display: block; }

.success-screen {
  text-align: center;
  padding: 40px 20px;
}
.success-yield {
  font-size: 3rem;
  font-weight: 800;
  color: var(--status-ok-text);
  margin: 16px 0;
}
.next-step-note {
  background: var(--status-info-bg);
  color: var(--status-info-text);
  padding: 12px 16px;
  border-radius: 12px;
  font-weight: 600;
  display: inline-block;
  margin-top: 12px;
}
