/* Festival WiFi captive portal — Linespotting AB
 * Mobile-first, white/professional, Svea hovrätt theme.
 */

:root {
  --navy: #1C1F66;
  --navy-700: #15184F;
  --navy-100: #E6E7F0;
  --gold: #C8A951;
  --gold-700: #A88A38;
  --white: #FFFFFF;
  --gray-50: #FAFAFA;
  --gray-100: #F5F5F5;
  --gray-200: #E5E7EB;
  --gray-400: #9CA3AF;
  --gray-600: #4B5563;
  --gray-800: #1F2937;
  --teal: #0891B2;
  --green: #059669;
  --amber: #D97706;
  --red: #DC2626;
  --swish-yellow: #FAB30D;
  --swish-yellow-700: #D89500;

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --shadow-sm: 0 1px 2px rgba(28, 31, 102, 0.06);
  --shadow-md: 0 4px 12px rgba(28, 31, 102, 0.10);
  --shadow-lg: 0 10px 28px rgba(28, 31, 102, 0.14);

  --font-system: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  --focus-ring: 0 0 0 3px rgba(28, 31, 102, 0.25);
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-system);
  color: var(--gray-800);
  background: var(--gray-100);
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: var(--navy);
  text-decoration: underline;
  text-underline-offset: 2px;
}

a:hover {
  color: var(--navy-700);
}

a:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
  border-radius: var(--radius-sm);
}

/* Layout */

.site-header {
  background: var(--white);
  border-bottom: 1px solid var(--gray-200);
  padding: 14px 16px;
}

.site-header-inner {
  max-width: 640px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-mark {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: var(--navy);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
}

.brand-mark svg {
  width: 22px;
  height: 22px;
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

.brand-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--navy);
  letter-spacing: 0.2px;
}

.brand-sub {
  font-size: 12px;
  color: var(--gray-600);
}

main {
  flex: 1;
  padding: 20px 16px 28px;
  display: flex;
  justify-content: center;
}

.card {
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: 22px 20px;
  width: 100%;
  max-width: 480px;
}

@media (min-width: 640px) {
  .card {
    max-width: 640px;
    padding: 32px 36px;
  }
  main {
    padding: 32px 16px 40px;
  }
}

/* Hero */

.hero h1 {
  margin: 0 0 6px;
  font-size: 26px;
  line-height: 1.2;
  color: var(--navy);
  letter-spacing: -0.2px;
}

.hero p.lede {
  margin: 0 0 18px;
  color: var(--gray-600);
  font-size: 15px;
}

.price-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--navy-100);
  color: var(--navy);
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 14px;
}

.price-pill .dot {
  width: 6px;
  height: 6px;
  background: var(--gold);
  border-radius: 50%;
}

/* Banner / Alert */

.banner {
  border-radius: var(--radius-md);
  padding: 12px 14px;
  font-size: 14px;
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin-bottom: 16px;
  border: 1px solid;
}

.banner-warn {
  background: #FFF8E1;
  border-color: #F2D27A;
  color: #6B4F00;
}

.banner-info {
  background: #ECFEFF;
  border-color: #A5E7F2;
  color: #075365;
}

.banner-error {
  background: #FEF2F2;
  border-color: #F5B5B5;
  color: #7B1D1D;
}

.banner strong {
  display: block;
  margin-bottom: 2px;
}

/* Form */

form.checkout {
  margin-top: 8px;
}

.field {
  margin-bottom: 14px;
}

.field label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--gray-800);
  margin-bottom: 6px;
}

.field .hint {
  font-size: 12px;
  color: var(--gray-600);
  margin-top: 4px;
}

.field input[type="email"],
.field input[type="tel"],
.field input[type="text"] {
  width: 100%;
  font: inherit;
  font-size: 16px; /* prevents iOS zoom */
  padding: 12px 14px;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-md);
  background: var(--white);
  color: var(--gray-800);
  transition: border-color 0.15s, box-shadow 0.15s;
}

.field input:focus {
  outline: none;
  border-color: var(--navy);
  box-shadow: var(--focus-ring);
}

.field input[aria-invalid="true"] {
  border-color: var(--red);
}

.field input[aria-invalid="true"]:focus {
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.20);
}

.field .err {
  margin-top: 6px;
  font-size: 13px;
  color: var(--red);
  min-height: 1em;
}

/* Checkbox */

.field-check {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin: 14px 0 18px;
}

.field-check input[type="checkbox"] {
  width: 20px;
  height: 20px;
  margin-top: 2px;
  flex: 0 0 auto;
  accent-color: var(--navy);
}

.field-check label {
  font-size: 14px;
  color: var(--gray-800);
  line-height: 1.45;
}

/* Buttons */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  border: 0;
  cursor: pointer;
  font: inherit;
  font-weight: 700;
  font-size: 16px;
  padding: 14px 18px;
  border-radius: var(--radius-md);
  transition: transform 0.05s, background 0.15s, box-shadow 0.15s;
  min-height: 50px;
  text-decoration: none;
}

.btn:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
}

.btn:active {
  transform: translateY(1px);
}

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

.btn-primary {
  background: var(--navy);
  color: var(--white);
}

.btn-primary:hover:not(:disabled) {
  background: var(--navy-700);
}

.btn-swish {
  background: var(--swish-yellow);
  color: #1B1B1B;
}

.btn-swish:hover:not(:disabled) {
  background: var(--swish-yellow-700);
  color: #1B1B1B;
}

.btn-secondary {
  background: var(--white);
  color: var(--navy);
  border: 1px solid var(--navy-100);
}

.btn-secondary:hover:not(:disabled) {
  background: var(--gray-50);
}

.btn-row {
  display: grid;
  gap: 10px;
  margin-top: 6px;
}

.btn-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--gray-400);
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin: 6px 0;
}

.btn-divider::before,
.btn-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--gray-200);
}

/* Footer */

.tiny-footer {
  margin-top: 18px;
  font-size: 12px;
  color: var(--gray-600);
  text-align: center;
  line-height: 1.55;
}

.tiny-footer a {
  color: var(--gray-600);
}

.site-footer {
  text-align: center;
  padding: 18px 16px 24px;
  font-size: 12px;
  color: var(--gray-600);
}

.site-footer a {
  color: var(--gray-600);
}

/* Spinner */

.spinner {
  width: 28px;
  height: 28px;
  border: 3px solid var(--navy-100);
  border-top-color: var(--navy);
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
}

.spinner-lg {
  width: 44px;
  height: 44px;
  border-width: 4px;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Loading overlay */

.overlay {
  position: fixed;
  inset: 0;
  background: rgba(255, 255, 255, 0.92);
  display: none;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 14px;
  z-index: 50;
  padding: 20px;
  text-align: center;
}

.overlay[aria-hidden="false"] {
  display: flex;
}

.overlay .msg {
  color: var(--navy);
  font-weight: 600;
}

/* Centered single-purpose pages (verify, success, error) */

.center-card {
  text-align: center;
}

.center-card h1 {
  color: var(--navy);
  margin: 8px 0 6px;
  font-size: 22px;
}

.center-card p {
  color: var(--gray-600);
  margin: 4px 0 14px;
  font-size: 15px;
}

.center-card .spinner-wrap {
  display: flex;
  justify-content: center;
  margin: 14px 0;
}

/* Legal pages (ToS, Privacy) */

.legal h1 {
  color: var(--navy);
  margin-top: 0;
  font-size: 24px;
}

.legal h2 {
  color: var(--navy);
  margin-top: 28px;
  font-size: 19px;
  border-bottom: 1px solid var(--gray-200);
  padding-bottom: 6px;
}

.legal h3 {
  color: var(--navy);
  font-size: 16px;
  margin-top: 18px;
  margin-bottom: 6px;
}

.legal p, .legal li {
  font-size: 15px;
  color: var(--gray-800);
}

.legal ul, .legal ol {
  padding-left: 22px;
}

.legal .meta {
  font-size: 13px;
  color: var(--gray-600);
  margin-bottom: 18px;
}

.legal .lang-toc {
  background: var(--gray-100);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  font-size: 14px;
  margin-bottom: 20px;
}

.back-link {
  display: inline-block;
  margin-top: 22px;
  font-size: 14px;
}

/* Screen reader only */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  .spinner {
    animation-duration: 2.4s;
  }
  .btn { transition: none; }
}
