/* Self-hosted styles only. No external fonts/CDNs so the page renders
   correctly inside captive-portal mini-browsers before the walled garden
   is fully configured. */

:root {
  --color-text: #ffffff;
  --color-muted: rgba(255, 255, 255, 0.72);
  --color-link: #e85d04;
  --color-button: #3a7fc1;
  --color-button-hover: #2f6eab;
  --color-card: rgba(12, 16, 24, 0.82);
  --color-checkbox: #3a7fc1;
}

* {
  box-sizing: border-box;
}

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

body {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  overflow-x: hidden;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--color-text);
  background: #0b1f3a;
}

/* Blurred photo sits on a separate layer so filter:blur does not soft-edge
   the viewport. Scale slightly past 100% to hide the blur fringe. */
.page-bg {
  position: fixed;
  inset: -40px;
  z-index: 0;
  background: url("../assets/portal_bg.jpg") center / cover no-repeat;
  filter: blur(14px);
  transform: scale(1.06);
  pointer-events: none;
}

.portal-card {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 440px;
  background: var(--color-card);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 18px;
  padding: 36px 32px 32px;
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.45);
  text-align: left;
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
}

.logo {
  display: block;
  width: 160px;
  max-width: 55%;
  height: auto;
  margin: 0 auto 28px;
}

h1 {
  font-size: 1.55rem;
  font-weight: 700;
  line-height: 1.25;
  margin: 0 0 28px;
  letter-spacing: -0.01em;
  text-align: center;
}

.terms-accept {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin: 0 0 22px;
  font-size: 0.95rem;
  line-height: 1.4;
  color: var(--color-text);
  cursor: pointer;
  user-select: none;
}

.terms-accept input[type="checkbox"] {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  margin-top: 2px;
  accent-color: var(--color-checkbox);
  cursor: pointer;
}

.terms-link {
  padding: 0;
  border: none;
  background: none;
  color: var(--color-link);
  font: inherit;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
}

.terms-link:hover,
.terms-link:focus-visible {
  color: #ff7a2e;
}

.terms-panel {
  margin: -8px 0 22px;
  padding: 12px 14px;
  max-height: 240px;
  overflow-y: auto;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.06);
  font-size: 0.85rem;
  line-height: 1.5;
  color: var(--color-muted);
  -webkit-overflow-scrolling: touch;
}

.terms-panel p,
.terms-panel ul {
  margin: 0 0 10px;
}

.terms-panel p:last-child,
.terms-panel ul:last-child {
  margin-bottom: 0;
}

.terms-panel h2 {
  margin: 14px 0 8px;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--color-text);
}

.terms-panel h2:first-child {
  margin-top: 0;
}

.terms-panel ul {
  padding-left: 1.2em;
}

.terms-panel li {
  margin-bottom: 8px;
}

.terms-panel li:last-child {
  margin-bottom: 0;
}

.accept-button {
  width: 100%;
  padding: 15px 20px;
  font-size: 1.05rem;
  font-weight: 600;
  border: none;
  border-radius: 10px;
  background: var(--color-button);
  color: #ffffff;
  cursor: pointer;
  transition: background 0.15s ease, opacity 0.15s ease;
}

.accept-button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.accept-button:not(:disabled):hover {
  background: var(--color-button-hover);
}

.status-message {
  min-height: 1.2em;
  margin: 16px 0 0;
  font-size: 0.9rem;
  color: var(--color-muted);
}

.debug-panel {
  margin-top: 20px;
  padding: 12px;
  background: #10141c;
  color: #9fe28a;
  border-radius: 8px;
  font-size: 0.75rem;
  text-align: left;
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-all;
}

@media (max-width: 480px) {
  body {
    padding: 16px;
  }

  .portal-card {
    padding: 28px 22px 24px;
  }

  .logo {
    width: 130px;
    margin-bottom: 22px;
  }

  h1 {
    font-size: 1.3rem;
    margin-bottom: 22px;
  }
}
