/* NABISWA WIFI design system  Section 5.
   Light palette: https://coolors.co/cff27e-f2dd6e-e5b25d
   Dark palette:  https://coolors.co/44355b-31263e-221e22
   Accent (sparing use): https://coolors.co/502f4c-70587c
*/
:root,
[data-theme="light"] {
  --color-primary: #7fae2e;      /* darkened for AA contrast on white; source hue #CFF27E */
  --color-primary-soft: #CFF27E;
  --color-secondary: #c9a52e;    /* darkened from #F2DD6E for text-safe use */
  --color-secondary-soft: #F2DD6E;
  --color-accent: #E5B25D;
  --color-bg: #FAFAF7;
  --color-surface: #FFFFFF;
  --color-surface-alt: #F1F3E9;
  --color-text: #221E22;
  --color-text-muted: #5b5760;
  --color-border: #E4E4DC;

  --status-success: #2f9e44;
  --status-warning: #d9a400;
  --status-danger: #d64545;
  --status-info: #3b7dd8;
}

[data-theme="dark"] {
  --color-primary: #CFF27E;
  --color-primary-soft: #a8d858;
  --color-secondary: #F2DD6E;
  --color-secondary-soft: #d9c65a;
  --color-accent: #E5B25D;
  --color-bg: #221E22;
  --color-surface: #31263E;
  --color-surface-alt: #44355B;
  --color-text: #F5F3F7;
  --color-text-muted: #b8aec4;
  --color-border: #4d3d63;

  --status-success: #4fd17a;
  --status-warning: #e8c34a;
  --status-danger: #ef6767;
  --status-info: #6aa6f2;

  --color-accent-alt-1: #502f4c;
  --color-accent-alt-2: #70587c;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

/* Make the native `hidden` attribute win even when a class on the same
   element (e.g. .modal-overlay, .badge) sets its own `display` value  
   otherwise that display rule silently cancels the browser's hidden
   behavior and the element shows up before JS ever unhides it. */
[hidden] { display: none !important; }

body {
  margin: 0;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background:
    linear-gradient(color-mix(in srgb, var(--color-bg) 82%, transparent),
                     color-mix(in srgb, var(--color-bg) 82%, transparent)),
    url("/static/images/LOGIC.png") center center / cover fixed no-repeat;
  color: var(--color-text);
  transition: background-color .2s ease, color .2s ease;
}

.app-shell { min-height: 100vh; display: flex; flex-direction: column; position: relative; z-index: 1; }

/* Soft floating circles drift on top of the background photo, behind the
   real content  purely decorative, never intercepts clicks. */
.bg-circles { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
.bg-circle { position: absolute; border-radius: 50%; opacity: .18; }
.bg-circle.c1 { width: 260px; height: 260px; background: var(--color-primary); top: -70px; left: -70px; animation: bgfloat1 9s ease-in-out infinite; }
.bg-circle.c2 { width: 190px; height: 190px; background: var(--color-secondary); bottom: -50px; right: -40px; animation: bgfloat2 8s ease-in-out infinite; }
.bg-circle.c3 { width: 140px; height: 140px; background: var(--color-accent); top: 45%; left: 6%; animation: bgfloat3 10s ease-in-out infinite; }
.bg-circle.c4 { width: 230px; height: 230px; background: var(--color-primary-soft); top: 68%; right: 10%; animation: bgfloat1 11s ease-in-out infinite; }
.bg-circle.c5 { width: 110px; height: 110px; background: var(--color-secondary-soft); top: 18%; right: 4%; animation: bgfloat2 7s ease-in-out infinite; }
.bg-circle.c6 { width: 170px; height: 170px; background: var(--color-primary); bottom: 15%; left: 14%; animation: bgfloat3 12s ease-in-out infinite; }
.bg-circle.c7 { width: 90px; height: 90px; background: var(--color-accent); top: 55%; left: 62%; animation: bgfloat2 9s ease-in-out infinite; }
@keyframes bgfloat1 { 0%, 100% { transform: translate(0,0); } 50% { transform: translate(22px, 24px); } }
@keyframes bgfloat2 { 0%, 100% { transform: translate(0,0); } 50% { transform: translate(-18px, -20px); } }
@keyframes bgfloat3 { 0%, 100% { transform: translate(0,0); } 50% { transform: translate(24px, -14px); } }

.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 24px; background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 1.1rem; }
.brand img { height: 32px; }

.theme-toggle {
  border: 1px solid var(--color-border); background: var(--color-surface-alt);
  color: var(--color-text); border-radius: 999px; padding: 6px 14px; cursor: pointer;
}

.card {
  background: var(--color-surface); border: 1px solid var(--color-border);
  border-radius: 6px; padding: 20px; box-shadow: none;
}

.grid {
  display: grid; gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  max-width: 1000px;
  margin: 0 auto;
  padding: 20px;
}

.badge {
  display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: .75rem; font-weight: 600;
}
.badge-success { background: color-mix(in srgb, var(--status-success) 18%, transparent); color: var(--status-success); }
.badge-warning { background: color-mix(in srgb, var(--status-warning) 18%, transparent); color: var(--status-warning); }
.badge-danger  { background: color-mix(in srgb, var(--status-danger) 18%, transparent); color: var(--status-danger); }
.badge-info    { background: color-mix(in srgb, var(--status-info) 18%, transparent); color: var(--status-info); }

.btn {
  border: none; border-radius: 6px; padding: 10px 18px; font-weight: 600;
  cursor: pointer; background: var(--color-primary); color: #1c2410;
  box-shadow: none; transition: transform .15s ease, background-color .15s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn-secondary { background: var(--color-surface-alt); color: var(--color-text); border: 1px solid var(--color-border); }

/* Compact package card  a small teal "header strip" (name + dot
   indicators) sits on top, then a short body with just the price and
   validity, then a full-width pill button. Keeping the body to 2 lines
   of text is what lets 4-6 cards fit on a small screen without scrolling
   past every single one. */
.package-card {
  display: flex; flex-direction: column; gap: 0;
  padding: 0; overflow: hidden; text-align: center;
}
.package-card .package-head {
  background: color-mix(in srgb, var(--color-primary) 22%, var(--color-surface-alt));
  padding: 14px 10px 10px;
}
.package-card .package-head h3 {
  margin: 0; font-size: .95rem; font-weight: 700; line-height: 1.2;
  min-height: 2.3em; display: flex; align-items: center; justify-content: center;
}
.package-card .package-dots { display: flex; justify-content: center; gap: 5px; margin-top: 8px; }
.package-card .package-dots span {
  width: 6px; height: 6px; border-radius: 50%;
  background: color-mix(in srgb, var(--color-text) 25%, transparent);
}
.package-card .package-dots span.active { background: var(--color-primary); }
.package-card .package-body { padding: 14px 12px 16px; display: flex; flex-direction: column; gap: 4px; }
.package-card .price { font-size: 1.5rem; font-weight: 800; color: var(--color-primary); margin: 0; }
.package-card .validity { margin: 0 0 10px; font-size: .8rem; color: var(--color-text-muted); }
.package-card .buy-btn { width: 100%; padding: 10px; border-radius: 8px; font-size: .9rem; }

/* Frosted glass: lets your background photo/circles show through while
   keeping package text fully readable. The plain rgba() line is a
   fallback for browsers that don't support color-mix()  declared first
   so the color-mix() line below overrides it wherever it's supported. */
.card.package-card {
  background: rgba(255, 255, 255, .18);
  background: color-mix(in srgb, var(--color-surface) 18%, transparent);
  border: 1px solid color-mix(in srgb, var(--color-border) 45%, transparent);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}
[data-theme="dark"] .card.package-card {
  background: rgba(30, 24, 40, .18);
  background: color-mix(in srgb, var(--color-surface) 18%, transparent);
}

form input, form select, form textarea,
.modal-card input, .modal-card select, .modal-card textarea {
  width: 100%; padding: 10px 12px; border-radius: 8px;
  border: 1px solid var(--color-border); background: var(--color-surface);
  color: var(--color-text); margin-bottom: 12px; font-size: 1rem;
}

table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--color-border); }

@media (max-width: 640px) {
  table, thead, tbody, th, td, tr { display: block; }
  thead { display: none; }
  tr { margin-bottom: 12px; border: 1px solid var(--color-border); border-radius: 10px; padding: 8px; }
  td { border: none; padding: 6px 8px; }
  td::before { content: attr(data-label); font-weight: 600; display: block; font-size: .75rem; color: var(--color-text-muted); }

  .grid { grid-template-columns: repeat(2, 1fr); gap: 10px; padding: 12px; max-width: none; }
  .package-card .package-head { padding: 12px 8px 8px; }
  .package-card .package-head h3 { font-size: .85rem; min-height: 2.1em; }
  .package-card .package-body { padding: 12px 10px 14px; }
  .package-card .price { font-size: 1.25rem; }
  .package-card .validity { font-size: .72rem; }
  .package-card .buy-btn { padding: 9px; font-size: .82rem; }
}

/* Purchase modal  this is what makes it float as a popup instead of
   sitting inline in the page. Without this block the modal renders as
   plain content, which is exactly what was happening. */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.55);
  display: flex; align-items: center; justify-content: center;
  z-index: 1000; padding: 16px;
}
.modal-card {
  background: rgba(255, 255, 255, .18);
  background: color-mix(in srgb, var(--color-surface) 18%, transparent);
  border: 1px solid color-mix(in srgb, var(--color-border) 45%, transparent);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  border-radius: 16px; padding: 28px 24px;
  max-width: 360px; width: 100%; text-align: center;
  box-shadow: 0 10px 40px rgba(0,0,0,.3);
  animation: modal-pop .18s ease-out;
}
[data-theme="dark"] .modal-card {
  background: rgba(30, 24, 40, .18);
  background: color-mix(in srgb, var(--color-surface) 18%, transparent);
}
@keyframes modal-pop { from { transform: scale(.92); opacity: 0; } to { transform: scale(1); opacity: 1; } }

/* "Get connected another way" section  same frosted-glass treatment as
   the package cards and the modal, so it doesn't look like a flat solid
   block against the photo background. */
#reconnect.card {
  background: rgba(255, 255, 255, .18);
  background: color-mix(in srgb, var(--color-surface) 18%, transparent);
  border: 1px solid color-mix(in srgb, var(--color-border) 45%, transparent);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}
[data-theme="dark"] #reconnect.card {
  background: rgba(30, 24, 40, .18);
  background: color-mix(in srgb, var(--color-surface) 18%, transparent);
}
.modal-card h3 { margin-top: 0; }

.spinner {
  width: 48px; height: 48px; margin: 4px auto 16px;
  border: 4px solid var(--color-border);
  border-top-color: var(--color-primary);
  border-radius: 50%;
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.dot-pulse { display: flex; justify-content: center; gap: 8px; margin: 8px auto 16px; }
.dot-pulse span { width: 10px; height: 10px; border-radius: 50%; background: var(--color-primary); animation: dot-pulse 1s ease-in-out infinite; }
.dot-pulse span:nth-child(2) { animation-delay: .15s; }
.dot-pulse span:nth-child(3) { animation-delay: .3s; }
@keyframes dot-pulse { 0%, 80%, 100% { transform: scale(.6); opacity: .4; } 40% { transform: scale(1); opacity: 1; } }

.result-icon { width: 56px; height: 56px; margin: 0 auto 12px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 1.8rem; font-weight: 700; color: #fff; }
.result-success { background: var(--status-success); }
.result-failure { background: var(--status-danger); }

.fab-stack {
  position: fixed; right: 18px; bottom: 90px; z-index: 500;
  display: flex; flex-direction: column; gap: 14px;
}
.fab {
  width: 52px; height: 52px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: #fff; box-shadow: 0 2px 6px rgba(0,0,0,.2);
  animation: fabFloat 3s ease-in-out infinite;
}
.fab:hover { animation-play-state: paused; transform: translateY(-3px); }
.fab-whatsapp { background: #25D366; }
.fab-call { background: var(--color-primary); animation-delay: .4s; }
@keyframes fabFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

@media (max-width: 480px) {
  .fab-stack { right: 12px; bottom: 80px; }
  .fab { width: 46px; height: 46px; }
}
/* Footer  same frosted-glass language as the package cards, so it
   doesn't sit as a flat block against the photo background. */
.site-footer {
  margin-top: 40px;
  padding: 40px 24px 20px;
  background: rgba(255, 255, 255, .12);
  background: color-mix(in srgb, var(--color-surface) 12%, transparent);
  border-top: 1px solid color-mix(in srgb, var(--color-border) 45%, transparent);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}
[data-theme="dark"] .site-footer {
  background: rgba(30, 24, 40, .12);
  background: color-mix(in srgb, var(--color-surface) 12%, transparent);
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.3fr 1fr 1fr;
  gap: 28px;
  max-width: 1000px;
  margin: 0 auto;
}
.footer-logo { height: 36px; margin-bottom: 8px; }
.footer-brand-name { margin: 0 0 6px; font-size: 1.05rem; font-weight: 800; color: var(--color-text); }
.footer-tagline { margin: 0; font-size: .82rem; color: var(--color-text-muted); line-height: 1.5; }

.footer-heading {
  margin: 0 0 12px; font-size: .78rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .07em; color: var(--color-primary);
}
.footer-link {
  display: flex; align-items: center; gap: 8px;
  color: var(--color-text); text-decoration: none;
  font-size: .85rem; margin-bottom: 10px; transition: color .15s, transform .15s;
}
.footer-link:hover { color: var(--color-primary); transform: translateX(3px); }
.footer-link-whatsapp:hover { color: #25D366; }
.footer-support { margin: 6px 0 0; font-size: .78rem; color: var(--color-text-muted); }

.footer-bottom {
  max-width: 1000px; margin: 28px auto 0;
  padding-top: 16px;
  border-top: 1px solid color-mix(in srgb, var(--color-border) 45%, transparent);
  text-align: center;
}
.footer-bottom p { margin: 0; font-size: .78rem; color: var(--color-text-muted); }

@media (max-width: 640px) {
  .footer-grid { grid-template-columns: 1fr; gap: 24px; text-align: center; }
  .footer-link { justify-content: center; }
  .site-footer { padding: 32px 16px 16px; }
}

