/* ═══════════════════════════════════════════════════════════════
   PROJECT AURORA — questionario-clinica.css
   Design System: Clinical Glassmorphism & High-Security HealthTech
   Conformity: CFM nº 2.314/2022, ANVISA RDC 63/2011, LGPD Art. 11
   ═══════════════════════════════════════════════════════════════ */

:root {
  --bg-deep: #060913;
  --bg-surface: rgba(11, 16, 33, 0.72);
  --bg-card: rgba(16, 23, 46, 0.65);
  --bg-card-hover: rgba(23, 34, 63, 0.85);
  --bg-input: rgba(7, 11, 22, 0.75);

  --border-glass: rgba(255, 255, 255, 0.08);
  --border-active: rgba(0, 242, 254, 0.45);
  --border-focus: #00f2fe;

  --accent-cyan: #00f2fe;
  --accent-cyan-glow: rgba(0, 242, 254, 0.25);
  --accent-violet: #8b5cf6;
  --accent-indigo: #6366f1;
  --accent-emerald: #10b981;
  --accent-rose: #f43f5e;
  --accent-amber: #f59e0b;

  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;

  --font-display: 'Syne', sans-serif;
  --font-body: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  background-color: var(--bg-deep);
  background-image: 
    radial-gradient(at 10% 10%, rgba(0, 242, 254, 0.06) 0px, transparent 50%),
    radial-gradient(at 90% 15%, rgba(139, 92, 246, 0.08) 0px, transparent 50%),
    radial-gradient(at 50% 95%, rgba(16, 185, 129, 0.05) 0px, transparent 55%);
  background-attachment: fixed;
  color: var(--text-primary);
  font-family: var(--font-body);
  line-height: 1.5;
  overflow-x: hidden;
  padding-bottom: 3rem;
}

/* ── Aurora Floating Orbs Background ────────────────────────── */
.aurora-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(110px);
  opacity: 0.45;
  animation: orbFloat 18s ease-in-out infinite alternate;
}

.orb-1 {
  width: 580px;
  height: 580px;
  top: -160px;
  left: -120px;
  background: radial-gradient(circle, #00f2fe 0%, transparent 70%);
}

.orb-2 {
  width: 520px;
  height: 520px;
  top: 20%;
  right: -160px;
  background: radial-gradient(circle, #8b5cf6 0%, transparent 70%);
  animation-delay: -6s;
  animation-duration: 22s;
}

.orb-3 {
  width: 440px;
  height: 440px;
  bottom: -100px;
  left: 30%;
  background: radial-gradient(circle, #6366f1 0%, transparent 70%);
  animation-delay: -11s;
  animation-duration: 16s;
  opacity: 0.35;
}

@keyframes orbFloat {
  0% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(32px, -36px) scale(1.08); }
  100% { transform: translate(-20px, 25px) scale(0.96); }
}

.grid-layer {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(0, 242, 254, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 242, 254, 0.025) 1px, transparent 1px);
  background-size: 40px 40px;
}

/* ── Typography & Display ───────────────────────────────────── */
.font-display {
  font-family: var(--font-display);
}

.font-mono {
  font-family: var(--font-mono);
}

/* ── Glassmorphism Panel ────────────────────────────────────── */
.glass-panel {
  background: var(--bg-surface);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid var(--border-glass);
  box-shadow: 
    0 20px 40px -15px rgba(0, 0, 0, 0.6),
    0 0 0 1px rgba(255, 255, 255, 0.04) inset;
}

.glass-card {
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.glass-card:hover {
  background: var(--bg-card-hover);
  border-color: rgba(0, 242, 254, 0.3);
  box-shadow: 0 10px 25px -5px rgba(0, 242, 254, 0.12);
}

/* ── Form Inputs & Selects ──────────────────────────────────── */
.form-label {
  display: block;
  font-size: 0.8125rem;
  font-weight: 600;
  color: #cbd5e1;
  margin-bottom: 0.375rem;
  letter-spacing: 0.02em;
}

.form-label .required {
  color: var(--accent-rose);
  margin-left: 0.2rem;
}

.form-input, .form-select, .form-textarea {
  width: 100%;
  background-color: var(--bg-input);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 0.65rem;
  padding: 0.6875rem 0.95rem;
  color: #f8fafc;
  font-family: var(--font-body);
  font-size: 0.9125rem;
  transition: all 0.2s ease;
  outline: none;
}

.form-input::placeholder, .form-textarea::placeholder {
  color: #64748b;
  font-size: 0.875rem;
}

.form-input:hover, .form-select:hover, .form-textarea:hover {
  border-color: rgba(255, 255, 255, 0.22);
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: var(--accent-cyan);
  box-shadow: 0 0 0 3px rgba(0, 242, 254, 0.18);
  background-color: rgba(11, 17, 36, 0.95);
}

.form-input.is-invalid, .form-select.is-invalid {
  border-color: var(--accent-rose) !important;
  box-shadow: 0 0 0 3px rgba(244, 63, 94, 0.18) !important;
}

.form-input.is-valid, .form-select.is-valid {
  border-color: var(--accent-emerald) !important;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.18) !important;
}

.field-error {
  display: none;
  font-size: 0.75rem;
  color: #fb7185;
  margin-top: 0.3rem;
  align-items: center;
  gap: 0.35rem;
}

.field-error.show {
  display: flex;
}

/* ── Interactive Selection Cards (Radio/Checkbox) ───────────── */
.selection-card {
  position: relative;
  cursor: pointer;
  border-radius: 0.85rem;
  padding: 1.1rem;
  border: 1.5px solid rgba(255, 255, 255, 0.08);
  background: rgba(16, 23, 46, 0.5);
  transition: all 0.22s ease-in-out;
  display: flex;
  align-items: flex-start;
  gap: 0.9rem;
  user-select: none;
}

.selection-card:hover {
  border-color: rgba(0, 242, 254, 0.35);
  background: rgba(23, 34, 63, 0.7);
  transform: translateY(-2px);
}

.selection-card.selected {
  border-color: var(--accent-cyan);
  background: rgba(0, 242, 254, 0.08);
  box-shadow: 
    0 8px 24px -6px rgba(0, 242, 254, 0.25),
    0 0 0 1px rgba(0, 242, 254, 0.3) inset;
}

.selection-card input[type="radio"],
.selection-card input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.card-icon-box {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  border-radius: 0.65rem;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
  color: var(--accent-cyan);
  transition: all 0.2s ease;
}

.selection-card.selected .card-icon-box {
  background: rgba(0, 242, 254, 0.18);
  border-color: var(--accent-cyan);
  color: #ffffff;
  box-shadow: 0 0 14px rgba(0, 242, 254, 0.4);
}

.custom-checkbox-dot {
  width: 20px;
  height: 20px;
  border-radius: 6px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  margin-left: auto;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  color: transparent;
  transition: all 0.2s ease;
}

.custom-radio-dot {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.3);
  margin-left: auto;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.selection-card.selected .custom-checkbox-dot {
  background: var(--accent-cyan);
  border-color: var(--accent-cyan);
  color: #060913;
}

.selection-card.selected .custom-radio-dot {
  border-color: var(--accent-cyan);
}

.selection-card.selected .custom-radio-dot::after {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-cyan);
}

/* ── Stepper Navigation Bar ─────────────────────────────────── */
.stepper-nav {
  position: relative;
  margin-bottom: 2.5rem;
}

.stepper-track {
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
  z-index: 2;
}

.stepper-progress-bg {
  position: absolute;
  top: 22px;
  left: 24px;
  right: 24px;
  height: 3px;
  background: rgba(255, 255, 255, 0.1);
  z-index: 1;
}

.stepper-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #8b5cf6, #6366f1, #00f2fe);
  transition: width 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 0 10px rgba(0, 242, 254, 0.6);
}

.step-node {
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
  background: transparent;
  border: none;
  color: inherit;
  font-family: inherit;
  z-index: 2;
  transition: transform 0.2s ease;
}

.step-node:focus-visible {
  outline: 2px solid var(--accent-cyan);
  outline-offset: 4px;
  border-radius: 8px;
}

.step-circle {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #0f1629;
  border: 2px solid rgba(255, 255, 255, 0.18);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text-secondary);
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

.step-node.active .step-circle {
  border-color: var(--accent-cyan);
  background: radial-gradient(circle, #0b1e36 0%, #081224 100%);
  color: var(--accent-cyan);
  box-shadow: 
    0 0 20px rgba(0, 242, 254, 0.5),
    0 0 0 4px rgba(0, 242, 254, 0.18);
  transform: scale(1.08);
}

.step-node.completed .step-circle {
  border-color: var(--accent-emerald);
  background: rgba(16, 185, 129, 0.18);
  color: var(--accent-emerald);
}

.step-label {
  margin-top: 0.5rem;
  font-size: 0.775rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--text-muted);
  text-align: center;
  transition: color 0.2s ease;
  max-width: 120px;
}

.step-node.active .step-label {
  color: #ffffff;
  font-weight: 700;
}

.step-node.completed .step-label {
  color: #cbd5e1;
}

/* ── Counter for Bed Capacity ───────────────────────────────── */
.counter-box {
  display: inline-flex;
  align-items: center;
  background: var(--bg-input);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 0.75rem;
  padding: 0.35rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}

.counter-btn {
  width: 44px;
  height: 44px;
  border-radius: 0.5rem;
  border: none;
  background: rgba(255, 255, 255, 0.07);
  color: white;
  font-size: 1.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.18s ease;
}

.counter-btn:hover:not(:disabled) {
  background: rgba(0, 242, 254, 0.25);
  color: var(--accent-cyan);
}

.counter-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.counter-input {
  width: 80px;
  background: transparent;
  border: none;
  font-family: var(--font-mono);
  font-size: 1.5rem;
  font-weight: 700;
  text-align: center;
  color: var(--accent-cyan);
  outline: none;
}

/* ── Digital Signature Canvas ───────────────────────────────── */
.signature-canvas-container {
  position: relative;
  border-radius: 0.85rem;
  border: 1.5px dashed rgba(255, 255, 255, 0.2);
  background: rgba(8, 12, 24, 0.7);
  overflow: hidden;
  transition: border-color 0.2s ease;
}

.signature-canvas-container:hover {
  border-color: rgba(0, 242, 254, 0.4);
}

.signature-canvas-container.has-signature {
  border-style: solid;
  border-color: var(--accent-emerald);
}

.signature-canvas-container.is-invalid {
  border-style: solid !important;
  border-color: var(--accent-rose) !important;
  box-shadow: 0 0 0 3px rgba(244, 63, 94, 0.22) !important;
}

#signaturePad {
  width: 100%;
  height: 180px;
  display: block;
  cursor: crosshair;
}

.signature-watermark {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: rgba(255, 255, 255, 0.15);
  font-size: 0.95rem;
  pointer-events: none;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-style: italic;
  font-family: var(--font-display);
  transition: opacity 0.2s ease;
}

.signature-watermark.hidden {
  opacity: 0;
}

/* ── Digital Seal Stamp (Carimbo Digital CFM/RT) ───────────── */
.digital-seal {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.1) 0%, rgba(6, 182, 212, 0.08) 100%);
  border: 1px solid rgba(16, 185, 129, 0.3);
  border-radius: 0.85rem;
  padding: 1.25rem;
  position: relative;
  overflow: hidden;
}

.digital-seal::before {
  content: '';
  position: absolute;
  top: -40px;
  right: -40px;
  width: 100px;
  height: 100px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(16, 185, 129, 0.25) 0%, transparent 70%);
}

.seal-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.65rem;
  border-radius: 9999px;
  font-size: 0.725rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: rgba(16, 185, 129, 0.2);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.4);
}

/* ── Buttons ────────────────────────────────────────────────── */
.btn-primary-aurora {
  background: linear-gradient(135deg, #00f2fe 0%, #6366f1 50%, #8b5cf6 100%);
  color: #060913;
  font-weight: 700;
  font-size: 0.95rem;
  padding: 0.85rem 1.75rem;
  border-radius: 0.75rem;
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  box-shadow: 0 4px 18px rgba(0, 242, 254, 0.35);
  transition: all 0.22s ease-in-out;
}

.btn-primary-aurora:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 242, 254, 0.55);
  color: #000;
}

.btn-primary-aurora:active {
  transform: translateY(0);
}

.btn-secondary-aurora {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #e2e8f0;
  font-weight: 600;
  font-size: 0.95rem;
  padding: 0.85rem 1.5rem;
  border-radius: 0.75rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  transition: all 0.2s ease;
}

.btn-secondary-aurora:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.25);
  color: #ffffff;
}

/* ── Toast Notifications ────────────────────────────────────── */
.toast-container {
  position: fixed;
  top: 1.5rem;
  right: 1.5rem;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  pointer-events: none;
}

.aurora-toast {
  pointer-events: auto;
  min-width: 300px;
  max-width: 420px;
  padding: 1rem 1.25rem;
  border-radius: 0.85rem;
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: 0 15px 35px -5px rgba(0, 0, 0, 0.7);
  animation: slideInRight 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  font-size: 0.875rem;
}

.aurora-toast.error {
  background: rgba(244, 63, 94, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: #ffffff;
}

.aurora-toast.success {
  background: rgba(16, 185, 129, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: #ffffff;
}

.aurora-toast.warning {
  background: rgba(245, 158, 11, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: #060913;
}

@keyframes slideInRight {
  from { opacity: 0; transform: translateX(50px); }
  to   { opacity: 1; transform: translateX(0); }
}

/* ── Custom Scrollbar ───────────────────────────────────────── */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: #060913;
}
::-webkit-scrollbar-thumb {
  background: #1e293b;
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
  background: #00f2fe;
}

/* ── Responsiveness ─────────────────────────────────────────── */
@media (max-width: 768px) {
  .stepper-track {
    overflow-x: auto;
    padding-bottom: 0.5rem;
  }
  .step-label {
    display: none;
  }
  .stepper-progress-bg {
    display: none;
  }
  .step-circle {
    width: 36px;
    height: 36px;
    font-size: 0.85rem;
  }
}
