/* ═══════════════════════════════════════════════════════════════
   TICCA — Desktop & Responsive Styles
═══════════════════════════════════════════════════════════════ */

/* ── Large screens: widen the form ── */
@media (min-width: 1200px) {
  .form-page-wrapper {
    max-width: 1100px;
  }

  .form-header {
    padding: var(--space-xl) var(--space-xxl) var(--space-lg);
  }

  .form-section {
    padding: var(--space-lg) var(--space-xxl);
  }

  .form-hotel-name {
    font-size: 30px;
  }
}

/* ── Medium screens ── */
@media (min-width: 768px) and (max-width: 1023px) {
  .form-page-wrapper {
    padding: var(--space-lg) var(--space-md);
  }

  .field-group--eighth {
    flex: 1 1 calc(16.666% - 14px);
    min-width: 90px;
  }

  .signature-area {
    grid-template-columns: 1fr;
    gap: var(--space-lg);
  }

  .qr-panel {
    grid-template-columns: 1fr;
  }

  .qr-code-container {
    margin: 0 auto;
  }
}

/* ── Tablet: show desktop layout ── */
@media (min-width: 768px) {
  #screen-desktop { display: block; }
  #screen-mobile  { display: none !important; }
}

/* ── Small tablet landscape: desktop with adjustments ── */
@media (min-width: 768px) and (max-width: 900px) {
  .stay-table {
    font-size: 11px;
  }

  .stay-table th,
  .stay-table td {
    padding: 6px 6px;
  }

  .form-header {
    grid-template-columns: 56px 1fr auto;
    gap: var(--space-md);
  }

  .hotel-logo-mark {
    width: 44px;
    height: 44px;
    font-size: 18px;
  }

  .form-hotel-name {
    font-size: 20px;
  }
}

/* ── Mobile: show wizard ── */
@media (max-width: 767px) {
  #screen-desktop { display: none !important; }
  #screen-mobile  { display: flex; }

  /* Mobile loading */
  #screen-loading {
    background: var(--navy);
  }

  /* Mobile success */
  .success-container {
    padding: var(--space-xl) var(--space-lg);
  }

  .success-container h1 {
    font-size: 30px;
  }

  /* Mobile error */
  .error-container {
    padding: var(--space-xl) var(--space-lg);
  }
}

/* ── Print styles: make the form printable ── */
@media print {
  .expiry-banner,
  .btn-primary,
  .btn-secondary,
  .btn-link,
  .btn-clear-sig,
  #btn-submit,
  #btn-refresh-qr,
  .qr-panel,
  .upload-fallback,
  .agreement-box {
    display: none !important;
  }

  body {
    background: white;
  }

  .form-page-wrapper {
    padding: 0;
    max-width: 100%;
  }

  .form-paper {
    box-shadow: none;
    border-radius: 0;
  }

  .form-section {
    break-inside: avoid;
  }

  .signature-canvas-wrapper {
    border: 1px solid #ccc;
    height: 80px;
  }
}

/* ── Focus visible for accessibility ── */
:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

/* ── Scrollbar styling (webkit) ── */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: var(--paper-warm);
}

::-webkit-scrollbar-thumb {
  background: var(--rule);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

/* ── Form validation states ── */
.field-error-msg {
  font-size: 11px;
  color: var(--error);
  margin-top: 4px;
  display: flex;
  align-items: center;
  gap: 4px;
}

/* ── Tooltip-style helper text ── */
.field-helper {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 4px;
  font-style: italic;
}

/* ── Section enter animation ── */
.form-section {
  animation: sectionReveal 0.4s ease-out both;
}

.form-section:nth-child(1) { animation-delay: 0.05s; }
.form-section:nth-child(2) { animation-delay: 0.10s; }
.form-section:nth-child(3) { animation-delay: 0.15s; }
.form-section:nth-child(4) { animation-delay: 0.20s; }
.form-section:nth-child(5) { animation-delay: 0.25s; }
.form-section:nth-child(6) { animation-delay: 0.30s; }

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

/* ── Gold rule accent on focused sections ── */
.form-section:focus-within .section-label {
  color: var(--gold);
}

/* ── Card number formatting ── */
.field-input--card:not(:placeholder-shown) {
  letter-spacing: 0.12em;
}
