/* ============================================================
   Vidoni / TongZ Portal — Landing & Dashboard Styles
   Design language: Gill Sans, pure black, greenyellow, frosted glass
   ============================================================ */

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

html {
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

:root {
  --font:          'Plus Jakarta Sans', 'Gill Sans', 'Gill Sans MT', -apple-system, BlinkMacSystemFont, sans-serif;
  --black:         #000;
  --white:         #fff;
  --green:         greenyellow;
  --green-dim:     #8ecc00;
  --vidoni-blue:   #a9bcc4; /* sampled from the Vidoni cube icon, desaturated toward grey */
  --surface:       rgba(255, 255, 255, 0.07);
  --surface-glass: rgba(255, 255, 255, 0.75);
  --border:        rgba(255, 255, 255, 0.12);
  --text-muted:    rgba(255, 255, 255, 0.72);
  --radius:        20px;
}

body {
  font-family: var(--font);
  background: var(--black);
  color: var(--white);
  line-height: 1.6;
  font-size: 17px;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px);
  background-size: 60px 60px;
}

a {
  color: var(--green);
  text-decoration: none;
}

a:hover {
  opacity: 0.85;
}


/* ============================================================
   Landing page — header
   ============================================================ */

.landing-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
}

.landing-header-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 28px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.landing-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 22px;
  font-weight: 700;
  color: var(--vidoni-blue);
  letter-spacing: -0.5px;
  text-shadow: 0 0 18px rgba(159, 216, 240, 0.4);
  text-decoration: none;
}

.landing-logo-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
}

.landing-nav {
  display: flex;
  align-items: center;
  gap: 28px;
}

.landing-nav-link {
  font-size: 15px;
  color: var(--text-muted);
  transition: color 0.15s;
}

.landing-nav-link:hover {
  color: var(--white);
  opacity: 1;
}


/* ============================================================
   Landing page — hero
   ============================================================ */

.landing-hero {
  position: relative;
  /* Was calc(100vh - 60px) — full-viewport height made sense when this hero
     held the long TongZ-specific copy (tagline + bullet points) that's since
     moved into the TongZ card below. The shorter suite-intro content now
     centered in a full-viewport box left a large empty gap above and below
     it, so this is a fixed floor instead — enough room for the decorative
     background, not a forced full screen. */
  min-height: 640px;
  display: flex;
  align-items: center;
  overflow: hidden;
  /* Gradient: green glow emanates from behind the login card on the right */
  background:
    radial-gradient(ellipse at 78% 40%, rgba(173, 255, 47, 0.18) 0%, transparent 50%),
    radial-gradient(ellipse at 10% 85%, rgba(0, 180, 255, 0.07) 0%, transparent 40%),
    radial-gradient(ellipse at 50% 0%,  rgba(173, 255, 47, 0.05) 0%, transparent 60%),
    transparent;
}

.hero-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
}

.hero-bg svg {
  width: 100%;
  height: 100%;
}

.hero-fade {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 55%;
  z-index: 1;
  background: linear-gradient(to bottom, transparent 0%, #000 100%);
  pointer-events: none;
}

.landing-hero-inner {
  position: relative;
  z-index: 2;
  max-width: 1100px;
  margin: 0 auto;
  padding: 60px 28px;
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 80px;
  /* Was align-items:center — the login card is much taller than the left
     copy column (fewer lines since the tagline/bullet points moved into the
     TongZ card), so centering the row against the taller column pushed the
     shorter one down, leaving a gap above the badge. Aligning both to the
     top removes that gap regardless of how tall the login card gets. */
  align-items: start;
  width: 100%;
}

.landing-hero-copy {
  /* Dark vignette behind the text so globe lines don't bleed through */
  background: radial-gradient(ellipse at 20% 50%, rgba(0,0,0,0.65) 0%, transparent 80%);
  padding: 24px 40px 24px 0;
  /* Grid items default to min-width:auto, which refuses to shrink below the
     content's intrinsic minimum (e.g. the app cards' natural width) — that's
     what was pushing the whole row wider than the container and clipping the
     login card next to it. min-width:0 lets this column actually shrink and
     wrap instead of overflowing. */
  min-width: 0;
}

.hero-app-badge {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(173, 255, 47, 0.25);
  border-radius: 100px;
  padding: 6px 16px 6px 6px;
  margin-bottom: 24px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--green);
}

/* Icon-less use (the top "Vidoni App Suite" hero badge) needs even padding. */
.hero-app-badge:not(:has(.hero-app-icon)) {
  padding: 6px 16px;
}

.hero-title-dim {
  color: var(--text-muted);
}

.landing-hero-title {
  font-size: clamp(44px, 6.5vw, 76px);
  font-weight: 800;
  letter-spacing: -2.5px;
  line-height: 1.02;
  margin-bottom: 24px;
  text-shadow: 0 2px 20px rgba(0,0,0,0.8);
}

.landing-hero-sub {
  font-size: 20px;
  color: var(--text-muted);
  max-width: 480px;
  margin-bottom: 20px;
  line-height: 1.7;
  font-weight: 500;
}

.hero-apps-grid {
  max-width: 560px;
  margin-top: 8px;
  /* The shared .apps-grid 260px-minimum card width needs ~540px to fit two
     cards side by side. That doesn't reliably fit the hero's 1fr column at
     viewport widths just above the 900px single-column breakpoint, causing
     the hero to overflow and clip the login card next to it. Hero cards are
     already compact (20px padding below), so let them shrink much further. */
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.hero-apps-grid .app-card {
  padding: 20px;
}

.landing-hero-tagline {
  font-size: 18px;
  font-weight: 700;
  color: var(--green);
  max-width: 480px;
  margin-bottom: 32px;
  line-height: 1.5;
}

.landing-hero-points {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 40px;
}

.landing-hero-points li {
  font-size: 16px;
  color: var(--text-muted);
  padding-left: 22px;
  position: relative;
}

.landing-hero-points li::before {
  content: '✓';
  position: absolute;
  left: 0;
  color: var(--green);
  font-weight: 700;
}

.hero-app-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
}

/* Plain-text CTA link — deliberately not a button */
.landing-text-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--green);
  font-size: 1rem;
  font-weight: 700;
  text-decoration: none;
  transition: gap 0.15s;
}

.landing-text-link:hover {
  gap: 10px;
  opacity: 1;
}

.landing-hero-auth {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  /* See .landing-hero-copy's min-width:0 comment — same grid-overflow fix. */
  min-width: 0;
}

/* Override the full-viewport admin-page styles when embedded in the landing hero */
.landing-hero-auth .admin-section {
  display: flex;
  min-height: auto;
  padding: 0;
  scroll-margin-top: 76px;
  align-items: flex-start;
  justify-content: stretch;
  overflow-y: visible;
}

.landing-hero-auth .admin-section[hidden] {
  display: none;
}

/* The frosted card rendered by login-view/register-view into .modal-content.
   Base rule so it looks right wherever it's mounted (the login hero, a modal
   dialog, or a plain page like profile.php) — not just inside the hero. */
.modal-content {
  background-color: rgba(255, 255, 255, 0.75);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.6);
  padding: 20px;
  color: #111;
}

/* Hero variant: stretch to fill its container instead of the default modal width/centering. */
.landing-hero-auth .modal-content {
  width: 100%;
  max-width: none;
}


/* ============================================================
   Buttons — matches TongZ design language
   ============================================================ */

.btn-primary {
  background-color: greenyellow;
  color: white;
  font-family: var(--font);
  font-size: 1rem;
  font-weight: bold;
  height: 50px;
  border: 1px solid white;
  border-radius: 20px;
  cursor: pointer;
  text-shadow: -1px -1px 0 #000, 1px -1px 0 #000, -1px 1px 0 #000, 1px 1px 0 #000;
  animation: modalButtonPulse 2.2s ease-in-out infinite;
}

@keyframes modalButtonPulse {
  0%   { box-shadow: 0 0 4px  1px rgba(0, 123, 255, 0.3); }
  50%  { box-shadow: 0 0 22px 6px rgba(0, 123, 255, 1.0); }
  100% { box-shadow: 0 0 4px  1px rgba(0, 123, 255, 0.3); }
}

.btn-primary:disabled {
  background: #3a3a3a;
  border-color: rgba(255, 255, 255, 0.2);
  cursor: not-allowed;
  text-shadow: none;
  animation: none;
}

/* Cancel / destructive — matches TongZ's design language */
.btn-cancel {
  background-color: salmon;
  color: white;
  font-family: var(--font);
  font-size: 1rem;
  font-weight: bold;
  height: 50px;
  border: 1px solid white;
  border-radius: 20px;
  cursor: pointer;
  text-shadow: -1px -1px 0 #000, 1px -1px 0 #000, -1px 1px 0 #000, 1px 1px 0 #000;
}

.btn-cancel:hover {
  background-color: rgb(210, 100, 80);
}

.btn-cancel:disabled {
  background: #3a3a3a;
  border-color: rgba(255, 255, 255, 0.2);
  cursor: not-allowed;
  text-shadow: none;
}

.form-actions {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 2rem;
  margin-bottom: 2rem;
}

.form-actions .btn-primary,
.form-actions .btn-cancel {
  width: auto;
  padding: 0 2.5rem;
}


/* ============================================================
   Landing page — sections
   ============================================================ */

.landing-section {
  padding: 80px 0;
  border-top: 1px solid var(--border);
}

/* Tighter than the default 80px — this section directly follows the suite
   hero and shouldn't read as a big gap before TongZ is introduced. */
.tongz-intro-section {
  padding: 40px 0;
  border-top: none;
}

.tongz-intro-card {
  /* Glass effect: translucent + blurred rather than a flat surface fill, with
     a tinted green border/glow so it reads as a distinct, elevated object.
     This card now encompasses ALL TongZ content on the page (see the
     .tongz-subsection blocks below), so it's brightened accordingly — a
     brighter background tint, a stronger green border, and an outer glow —
     so it still reads clearly as one bright, unified surface at that length. */
  background:
    radial-gradient(ellipse at 20% 0%, rgba(173, 255, 47, 0.10) 0%, transparent 55%),
    rgba(255, 255, 255, 0.09);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid rgba(173, 255, 47, 0.4);
  border-radius: var(--radius);
  padding: 40px 48px;
  box-shadow: 0 8px 48px rgba(0, 0, 0, 0.35), 0 0 60px rgba(173, 255, 47, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

/* Divider between each TongZ topic nested inside the unified card, replacing
   the border-top + 80px padding each used to get from being its own
   top-level .landing-section. Lighter than the page's --border since it's an
   internal seam within one card, not a boundary between page sections. */
.tongz-subsection {
  padding-top: 32px;
  margin-top: 32px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

/* The mission section's full-height treatment is for standalone sections;
   inside a unified card its content defines the appropriate height. */
.tongz-subsection.mission-section {
  min-height: 0;
}

/* Pull the badge/title/sub/tagline/points together — the original hero
   spacing was designed for a full-height hero, not a compact card. */
.tongz-intro-card .hero-app-badge {
  margin-bottom: 16px;
}

.tongz-intro-card .landing-hero-title {
  margin-bottom: 12px;
}

.tongz-intro-card .landing-hero-sub {
  margin-bottom: 12px;
}

.tongz-intro-card .landing-hero-tagline {
  margin-bottom: 20px;
}

.tongz-intro-card .landing-hero-points {
  margin-bottom: 0;
}

.landing-section-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 28px;
}

.landing-section-eyebrow {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--green);
  margin-bottom: 12px;
}

.landing-section-title {
  font-size: clamp(28px, 4vw, 44px);
  font-weight: 800;
  letter-spacing: -1.5px;
  margin-bottom: 48px;
  line-height: 1.1;
}


/* ============================================================
   App showcase
   ============================================================ */

.showcase-inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
  align-items: center;
}

.showcase-copy {
  display: flex;
  flex-direction: column;
}

.showcase-body {
  font-size: 18px;
  color: var(--text-muted);
  line-height: 1.8;
  margin-top: 16px;
  font-weight: 500;
}

.showcase-phone {
  display: flex;
  justify-content: center;
  align-items: center;
}

.phone-mockup {
  width: 100%;
  max-width: 420px;
  border-radius: 24px;
  display: block;
}

@media (max-width: 900px) {
  .showcase-inner {
    grid-template-columns: 1fr;
    gap: 40px;
  }

  .showcase-copy {
    order: 1;
  }

  .showcase-phone {
    order: 2;
  }

  .phone-mockup {
    max-width: 320px;
  }

  .tongz-intro-card {
    padding: 28px;
  }
}


/* ============================================================
   Use cases
   ============================================================ */

.use-cases-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.use-case-card {
  padding: 32px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: border-color 0.2s, background 0.2s;
}

.use-case-card:hover {
  border-color: rgba(173, 255, 47, 0.25);
  background: rgba(173, 255, 47, 0.04);
}

.use-case-icon {
  font-size: 28px;
  line-height: 1;
}

.use-case-card h3 {
  font-size: 19px;
  font-weight: 700;
}

.use-case-card p {
  font-size: 15px;
  color: var(--text-muted);
  line-height: 1.7;
}


/* ============================================================
   Language coverage
   ============================================================ */

.languages-inner {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 60px;
  align-items: center;
}

.languages-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: var(--surface);
  border: 1px solid rgba(173, 255, 47, 0.2);
  border-radius: var(--radius);
  padding: 40px 56px;
  box-shadow: 0 0 40px rgba(173, 255, 47, 0.06);
}

.languages-number {
  font-size: 72px;
  font-weight: 800;
  color: var(--green);
  line-height: 1;
  letter-spacing: -2px;
  text-shadow: 0 0 30px rgba(173, 255, 47, 0.4);
}

.languages-label {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-top: 8px;
}

/* :not() excludes the eyebrow — otherwise this generic p selector's higher
   specificity silently overrides .landing-section-eyebrow's green small-caps
   styling, making it look like plain body text instead of a matching eyebrow. */
.languages-copy p:not(.landing-section-eyebrow) {
  font-size: 16px;
  color: var(--text-muted);
  line-height: 1.75;
  margin-top: 16px;
  max-width: 560px;
}

@media (max-width: 900px) {
  .languages-inner {
    grid-template-columns: 1fr;
    gap: 32px;
    text-align: center;
  }

  .languages-stat {
    width: 100%;
  }

  .mission-flags {
    justify-content: center;
  }
}

@media (max-width: 480px) {
  .mission-flags {
    justify-content: center;
    font-size: 28px;
    gap: 10px;
  }
}


/* ============================================================
   The bigger picture
   ============================================================ */

.mission-section {
  position: relative;
  overflow: hidden;
  min-height: 640px;
  display: flex;
  align-items: center;
}

.mission-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
}

.mission-bg svg {
  width: 100%;
  height: 100%;
  display: block;
}

.mission-inner {
  position: relative;
  z-index: 1;
  max-width: 760px;
  text-align: center;
  margin: 0 auto;
}

.mission-inner .landing-section-eyebrow,
.mission-inner .landing-section-title {
  text-align: center;
}

.mission-flags {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 16px;
  font-size: 40px;
  line-height: 1;
  margin-top: 24px;
  filter: drop-shadow(0 4px 16px rgba(0, 0, 0, 0.6));
}

.mission-body {
  font-size: 17px;
  color: var(--text-muted);
  line-height: 1.8;
  margin-top: 20px;
}


/* ============================================================
   Pricing
   ============================================================ */

.landing-pricing-inner {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 60px;
  align-items: center;
}

/* Same eyebrow-override fix as .languages-copy p above. */
.landing-pricing-copy p:not(.landing-section-eyebrow) {
  font-size: 16px;
  color: var(--text-muted);
  line-height: 1.75;
  margin-top: 16px;
}

.landing-cta-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 28px;
  margin-top: 20px;
  text-decoration: none;
}

.landing-pricing-card {
  position: relative;
  background: linear-gradient(160deg, rgba(173, 255, 47, 0.09) 0%, rgba(255, 255, 255, 0.04) 100%);
  border: 1px solid rgba(173, 255, 47, 0.25);
  border-radius: var(--radius);
  padding: 36px 36px 32px;
  text-align: left;
  overflow: hidden;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow: 0 0 50px rgba(173, 255, 47, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.pricing-card-icon {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  background: rgba(173, 255, 47, 0.12);
  font-size: 20px;
  margin-bottom: 20px;
}

.pricing-headline {
  font-size: 24px;
  font-weight: 800;
  color: var(--white);
  line-height: 1.3;
  letter-spacing: -0.5px;
}

.pricing-headline em {
  color: var(--green);
  font-style: normal;
  text-shadow: 0 0 24px rgba(173, 255, 47, 0.5);
}

.pricing-note {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.6;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}


/* ============================================================
   Ambient page glow
   ============================================================ */

.page-glow {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: radial-gradient(ellipse 80% 100% at 50% 100%, rgba(173, 255, 47, 0.28) 0%, rgba(173, 255, 47, 0.1) 40%, transparent 75%);
}


/* ============================================================
   Footer
   ============================================================ */

.landing-footer {
  position: relative;
  overflow: hidden;
  border-top: 1px solid var(--border);
  padding: 32px 0;
}

.landing-footer-inner {
  position: relative;
  z-index: 1;
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 28px;
  display: flex;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
}

.landing-footer-brand {
  font-weight: 700;
  font-size: 15px;
  margin-right: auto;
  color: var(--text-muted);
}

.landing-footer-nav {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
}

.landing-footer-link,
.admin-clear-link {
  font-size: 13px;
  color: var(--text-muted);
}

.landing-footer-link:hover,
.admin-clear-link:hover {
  color: var(--white);
  opacity: 1;
}

.landing-footer-copy {
  font-size: 13px;
  color: var(--text-muted);
}


/* ============================================================
   Dashboard page
   ============================================================ */

.dashboard-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 10px 28px;
  min-height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  row-gap: 10px;
}

.site-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 22px;
  font-weight: 700;
  color: var(--vidoni-blue);
  text-decoration: none;
  text-shadow: 0 0 18px rgba(159, 216, 240, 0.4);
  white-space: nowrap;
}

.site-logo-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
}

.site-nav {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px 20px;
}

.nav-user {
  font-size: 15px;
  color: var(--text-muted);
  white-space: nowrap;
}

.nav-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 38px;
  padding: 0 18px;
  font-family: var(--font);
  font-size: 14px;
  font-weight: bold;
  cursor: pointer;
  color: var(--text-muted);
  transition: color 0.15s, border-color 0.15s;
  white-space: nowrap;
}

@media (max-width: 640px) {

  .header-inner {
    padding: 10px 16px;
  }

  .site-nav {
    gap: 8px 12px;
  }

  .nav-user {
    flex-basis: 100%;
  }

  .nav-btn {
    height: 34px;
    padding: 0 12px;
    font-size: 13px;
  }

}

.nav-btn:hover {
  color: var(--white);
  border-color: rgba(255, 255, 255, 0.3);
}

/* Inverted nav-btn — white fill, black text, for a button that should stand
   out from the rest of the (dark, outlined) nav at a glance, e.g. Admin.
   Selector is .nav-btn.nav-btn-invert (not just .nav-btn-invert) so it
   reliably outranks the shared .nav-btn/.app-card/... surface-color rule
   below regardless of source order. */
.nav-btn.nav-btn-invert {
  background: var(--white);
  border-color: var(--white);
  color: var(--black);
}

.nav-btn.nav-btn-invert:hover {
  background: rgba(255, 255, 255, 0.85);
  border-color: rgba(255, 255, 255, 0.85);
  color: var(--black);
}

.dashboard-main {
  flex: 1;
  padding: 60px 0;
}

.section-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 28px;
}

.section-title,
.dashboard-title {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.5px;
  margin-bottom: 32px;
}

.apps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 20px;
}

.nav-btn,
.app-card,
.use-case-card,
.admin-stat-tile {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.app-card {
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  text-decoration: none;
  color: var(--white);
  transition: border-color 0.2s, background 0.2s;
}

.app-card:hover {
  border-color: rgba(173, 255, 47, 0.25);
  background: rgba(173, 255, 47, 0.04);
  opacity: 1;
}

.app-card-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 18px;
  color: #000;
}

.tongz-icon       { border: 1px solid rgba(255, 255, 255, 0.6); }

.app-card-icon-img {
  width: 44px;
  height: 44px;
  border-radius: 8px;
  object-fit: cover;
}
.blynk-icon       { background: #4caf50; }
.weather-icon     { background: #2196f3; }
.cal-icon         { background: #e91e63; }
.shopmate-icon    { background: #fa8072; } /* salmon */
.storefinder-icon { border: 1px solid rgba(255, 255, 255, 0.6); }

.storefinder-icon .app-card-icon-img {
  width: 34px;
  height: 34px;
}

.app-card-name {
  font-size: 18px;
  font-weight: 700;
}

.app-card-desc {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.6;
}

.app-card-disabled {
  pointer-events: none;
  filter: grayscale(1);
  opacity: 0.45;
}

.app-card-disabled:hover {
  border-color: var(--border);
  background: var(--surface);
}

.app-card-badge {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted);
}


/* ============================================================
   Profile page
   ============================================================ */

.profile-main {
  flex: 1;
  width: 100%;
  max-width: 640px;
  margin: 0 auto;
  padding: 2rem 1rem 4rem;
  box-sizing: border-box;
}

.profile-main .modal-content {
  width: 100%;
  max-width: none;
  /* auth-forms.css's .register-card caps max-height at 90svh with its own
     overflow-y: auto — needed when index.php centers the card inside a
     full-viewport .admin-section (a real modal-like overlay), so a tall
     card scrolls internally instead of being clipped off-screen by the
     vertical centering. profile.php renders this same class in normal page
     flow, not inside .admin-section, so that cap only produces a useless
     nested scrollbar on top of the page's own scroll — let it size to its
     content and scroll with the page instead. */
  max-height: none;
  overflow-y: visible;
  box-sizing: border-box;
  background: rgba(255, 255, 255, 0.04);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1.5rem;
  color: var(--white);
}

.profile-main .register-card h1 {
  text-align: left;
  font-size: 1.3rem;
  margin-bottom: 1rem;
}

.profile-main .register-card label {
  color: rgba(255, 255, 255, 0.85);
}

.profile-main .register-card input {
  background-color: rgba(255, 255, 255, 0.06);
  color: var(--white);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.profile-main .register-card input::placeholder {
  color: rgba(255, 255, 255, 0.35);
}

.profile-main .register-card .error {
  color: #ff6b6b;
}

.profile-main .register-card .success,
.profile-main .register-card .login-link a,
.profile-main .register-card .password-toggle {
  color: var(--green);
}

.profile-main .register-card .password-toggle:hover {
  color: #c6ff6b;
}


/* ============================================================
   Account pages
   ============================================================ */

.account-main {
  flex: 1;
  width: 100%;
  max-width: 640px;
  margin: 0 auto;
  padding: 2rem 1rem 4rem;
  box-sizing: border-box;
}

.account-main--narrow {
  max-width: 480px;
}

.account-main--wide {
  max-width: 680px;
}

.contact-main .account-msg {
  margin-top: 0.75rem;
  text-align: center;
  line-height: 1.5;
}

.contact-main .form-actions {
  margin-top: 0.75rem;
  margin-bottom: 0.25rem;
}

.account-card {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1.5rem;
}

.account-card + .account-card {
  margin-top: 1.5rem;
}

.account-card .intro {
  opacity: 0.7;
  font-size: 0.9rem;
  line-height: 1.6;
  margin-bottom: 1.5rem;
}

.account-card label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.85);
  margin-bottom: 0.25rem;
}

.contact-apps {
  border: 0;
  margin: 0 0 1rem;
}

.contact-apps legend {
  font-size: 0.85rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.85);
  margin-bottom: 0.625rem;
}

.account-card .contact-apps label {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-height: 3rem;
  margin: 0 0 0.5rem;
  padding: 0.625rem 0.75rem;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--white);
  font-size: 0.95rem;
  font-weight: 500;
  line-height: 1.35;
  cursor: pointer;
  transition: border-color 0.15s, background-color 0.15s;
}

.account-card .contact-apps label:hover {
  border-color: rgba(173, 255, 47, 0.65);
  background: rgba(173, 255, 47, 0.1);
}

.account-card .contact-apps input {
  flex: 0 0 1.25rem;
  width: 1.25rem;
  height: 1.25rem;
  margin: 0;
  padding: 0;
  accent-color: var(--green);
}

.account-card .contact-apps label:has(input:checked) {
  border-color: var(--green);
  background: rgba(173, 255, 47, 0.16);
}

.account-card .contact-apps label:has(input:focus-visible) {
  outline: 2px solid var(--green);
  outline-offset: 2px;
}

.account-card input,
.account-card select,
.account-card textarea {
  width: 100%;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background-color: rgba(255, 255, 255, 0.06);
  color: var(--white);
  box-sizing: border-box;
  padding: 0.6rem 0.75rem;
  margin-bottom: 1rem;
  font-family: inherit;
  font-size: 16px;
}

.account-card select[size] {
  appearance: none;
  padding: 0.25rem;
  height: auto;
  overflow-y: hidden;
}

.account-card select[size] option {
  background-color: #1a1a1a;
  color: var(--white);
  padding: 0.4rem 0.6rem;
  border-radius: 4px;
  margin-bottom: 3px;
}

.account-card select[size] option:checked {
  background-color: rgba(173, 255, 47, 0.18);
  color: var(--green);
}

.account-card textarea {
  min-height: 140px;
  resize: vertical;
}

.account-card input::placeholder,
.account-card textarea::placeholder {
  color: rgba(255, 255, 255, 0.35);
}

.account-msg {
  margin-top: 1rem;
  font-size: 0.9rem;
  min-height: 1.2em;
}

.account-msg.error {
  color: #ff6b6b;
}

.account-msg.success {
  color: var(--green);
}

.account-section-title {
  margin-bottom: 0.5rem;
}

.account-section-intro {
  opacity: 0.7;
  font-size: 0.9rem;
}

.balance-amount {
  font-size: 2.4rem;
  font-weight: 700;
  color: var(--green);
}

.balance-label,
.admin-stat-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.plan-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 1rem 0;
}

.plan-btn {
  flex: 1 1 auto;
  min-width: 90px;
  padding: 0.75rem 1rem;
  border-radius: 10px;
  border: 1.5px solid rgba(255, 255, 255, 0.2);
  background: transparent;
  color: var(--white);
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.15s ease;
}

.plan-btn:hover,
.plan-btn.selected {
  border-color: var(--green);
}

.plan-btn.selected {
  background: rgba(173, 255, 47, 0.12);
}

#payment-element {
  margin: 1rem 0;
}

.pay-btn {
  width: 100%;
  padding: 0.9rem;
  border-radius: 10px;
  border: none;
  background: var(--green);
  color: #000;
  font-size: 1.05rem;
  font-weight: 600;
  cursor: pointer;
}

.pay-btn:disabled {
  opacity: 0.5;
  cursor: default;
}

.hidden {
  display: none;
}

.credit-note {
  font-size: 0.8rem;
  opacity: 0.55;
  margin-top: 0.75rem;
}

.ledger-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.ledger-table th {
  text-align: left;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  opacity: 0.55;
  font-weight: 600;
  padding: 0 0.5rem 0.5rem 0;
}

.ledger-table th.ledger-header-number,
.ledger-table td.ledger-amount {
  text-align: right;
}

.ledger-table td {
  padding: 0.55rem 0.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.ledger-table td.ledger-amount {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.ledger-amount.credit {
  color: var(--green);
}

.ledger-amount.debit {
  color: #ff9b9b;
}

.ledger-app {
  opacity: 0.7;
  text-transform: capitalize;
}

.ledger-empty {
  opacity: 0.55;
  font-size: 0.9rem;
}

.legal-main .account-card .updated {
  font-size: 0.8rem;
  opacity: 0.5;
  margin-bottom: 2rem;
}

.legal-main .account-card h2 {
  font-size: 0.95rem;
  font-weight: 600;
  margin-top: 1.5rem;
  margin-bottom: 0.5rem;
  color: var(--white);
}

.legal-main .account-card p,
.legal-main .account-card ul {
  font-size: 0.9rem;
  line-height: 1.6;
  margin-bottom: 0.75rem;
  color: var(--text-muted);
}

.legal-main .account-card ul {
  padding-left: 1.25rem;
}

.legal-main .account-card li {
  margin-bottom: 0.4rem;
}

.legal-main .account-card a {
  color: var(--green);
  text-decoration: none;
}

.legal-main .account-card a:hover {
  text-decoration: underline;
}

.faq-item {
  border: 1px solid var(--border);
  border-radius: 10px;
  margin-bottom: 0.6rem;
  background: rgba(255, 255, 255, 0.03);
  overflow: hidden;
}

.faq-item summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--white);
}

.faq-item summary::-webkit-details-marker {
  display: none;
}

.faq-item summary::after {
  content: '+';
  flex-shrink: 0;
  font-size: 1.3rem;
  font-weight: 400;
  line-height: 1;
  color: var(--green);
  transition: transform 0.15s ease;
}

.faq-item[open] summary::after {
  transform: rotate(45deg);
}

.faq-item summary:hover {
  color: var(--green);
}

.faq-item .faq-answer {
  padding: 0 1rem 1rem;
}

.faq-item .faq-answer p {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.6;
  color: var(--text-muted);
}

/* ============================================================
   Responsive
   ============================================================ */

@media (max-width: 900px) {
  .landing-hero {
    min-height: auto;
  }

  .landing-hero-inner {
    grid-template-columns: 1fr;
    gap: 48px;
    padding: 20px 28px 60px;
  }

  .landing-hero-copy {
    padding-top: 0;
  }

  .landing-pricing-inner {
    grid-template-columns: 1fr;
    gap: 40px;
  }

  .landing-pricing-card {
    width: 100%;
  }

  .use-cases-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 640px) {
  .use-cases-grid {
    grid-template-columns: 1fr;
  }

  .landing-footer-inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
  }

  .landing-footer-brand {
    margin-right: 0;
  }
}


/* ============================================================
   Admin console (stage/admin/)

   Card/heading/table language is intentionally NOT reinvented here —
   sections reuse account.php's existing .account-card / .account-section-title
   / .ledger-table classes directly, so the admin console reads as the same
   product rather than a parallel design. Only what account.php genuinely has
   no equivalent for (tabs, health/status pills, a grid of stat tiles) gets a
   new class below.
   ============================================================ */

/* Scoped to .admin-page (set on <body> by admin_layout.php) so this doesn't
   also brighten .account-card's border on account.php/contact.php/privacy.php/
   terms.php — a thin, visible keyline so each card reads as a distinct block
   at a glance, stronger than the site's default --border but still grey/quiet
   rather than an accent color. */
.admin-page .account-card {
  border-color: rgba(255, 255, 255, 0.45);
}

.admin-subnav .header-inner {
  min-height: 0;
  padding-top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}

/* Which environment's data the whole page below is scoped to — see
   AdminRenderHeader()'s own comment. Live gets the attention-drawing amber
   (matches .admin-status-material_divergence) since it's real money/users;
   Stage stays the plain neutral pill so Live is the one that stands out. */
.admin-env-badge-live {
  color: #ffb347;
  border-color: rgba(255, 179, 71, 0.35);
}

.admin-env-badge-stage {
  color: var(--text-muted);
}

.admin-tabs {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.admin-tab {
  display: inline-flex;
  align-items: center;
  height: 34px;
  padding: 0 16px;
  font-size: 14px;
  font-weight: bold;
  border-radius: var(--radius);
  color: var(--text-muted);
  border: 1px solid transparent;
}

.admin-tab:hover {
  color: var(--white);
  opacity: 1;
}

.admin-tab-active {
  color: var(--black);
  background: var(--green);
}

.admin-tab-active:hover {
  color: var(--black);
}

/* account.php's h2/h3 sizing is scoped to .account-card so those exact rules
   (account-section-title, and this smaller h3 for a subsection within a
   card) apply here too without redeclaring anything. */
.account-card h3 {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin: 28px 0 12px;
}

.account-card h3:first-of-type {
  margin-top: 0;
}

.table-scroll {
  overflow-x: auto;
}

.admin-stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
}

.admin-stat-tile {
  padding: 20px 22px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Stat tiles nested inside a card already have the card's own border/background
   to define the group — a second border per tile reads as visual clutter, so
   tiles go flat here and rely on the surrounding card for structure — same
   effect as matching the card's own background, but expressed as "blend in"
   rather than a coincidental copy of that exact value. */
.account-card .admin-stat-tile {
  background: transparent;
  border-color: transparent;
}

.admin-stat-value {
  font-size: 26px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.admin-stat-value-small {
  font-size: 16px;
  font-weight: 600;
  word-break: break-word;
}

.admin-stat-negative {
  color: #ff6b6b;
}

.admin-health-tile {
  border-left: 3px solid var(--border);
}

.admin-health-healthy {
  border-left-color: var(--green);
}

.admin-health-healthy .admin-stat-value {
  color: var(--green);
}

.admin-health-unhealthy,
.admin-health-unreachable,
.admin-health-unknown {
  border-left-color: #ff6b6b;
}

.admin-health-unhealthy .admin-stat-value,
.admin-health-unreachable .admin-stat-value,
.admin-health-unknown .admin-stat-value {
  color: #ff6b6b;
}

.admin-status {
  display: inline-flex;
  align-items: center;
  height: 24px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  text-transform: capitalize;
  background: var(--surface);
  border: 1px solid var(--border);
}

.admin-status-active,
.admin-status-ok,
.admin-status-clean {
  color: var(--green);
  border-color: rgba(173, 255, 47, 0.35);
}

.admin-status-locked,
.admin-status-alert,
.admin-status-mismatch,
.admin-status-critical_divergence {
  color: #ff6b6b;
  border-color: rgba(255, 107, 107, 0.35);
}

.admin-status-material_divergence {
  color: #ffb347;
  border-color: rgba(255, 179, 71, 0.35);
}

.admin-search-form {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}

/* No dedicated input class — the search box sits inside an .account-card, so
   it already gets that card's generic `input` styling for free. */
.admin-search-form input {
  flex: 1 1 240px;
  margin-bottom: 0;
}

.admin-action-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.admin-action-row input {
  width: 220px;
  margin-bottom: 0;
}

.nav-btn[disabled] {
  opacity: 0.4;
  pointer-events: none;
}

.admin-more-link {
  font-size: 14px;
  margin-top: 16px;
  display: inline-block;
}

.admin-recon-refresh {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--text-muted);
  margin: 4px 0;
}

.admin-recon-lag {
  font-size: 12px;
  color: var(--text-muted);
  opacity: 0.75;
  margin: 0 0 16px;
}

/* Shared compact button for every in-page admin action: table-row "View",
   "Refresh now", "Clear" filter, "Full finance breakdown" — anything that
   does something (navigates or triggers an action) reads as a button, not
   a plain link, regardless of whether it's an <a> or <button> underneath. */
.admin-action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 30px;
  padding: 0 14px;
  font-family: var(--font);
  font-size: 13px;
  font-weight: bold;
  cursor: pointer;
  color: var(--text-muted);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  text-decoration: none;
  white-space: nowrap;
  transition: color 0.15s, border-color 0.15s;
}

.admin-action-btn:hover {
  color: var(--white);
  border-color: rgba(255, 255, 255, 0.3);
}

.account-card .admin-select {
  -webkit-appearance: none;
  appearance: none;
  box-sizing: border-box;
  width: auto;
  height: 30px;
  padding: 0 28px 0 12px;
  margin-bottom: 0;
  font-family: var(--font);
  font-size: 13px;
  font-weight: bold;
  line-height: normal;
  color: var(--text-muted);
  background-color: var(--surface);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8' fill='none'%3E%3Cpath d='M1 1.5L6 6.5L11 1.5' stroke='%23999999' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 10px 7px;
  border: 1px solid var(--border);
  border-radius: 999px;
  cursor: pointer;
}

.admin-issuance-control {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.admin-issuance-status {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 8px;
  font-size: 14px;
  font-weight: bold;
}

.admin-issuance-reason {
  font-weight: normal;
  color: var(--text-muted);
}

.admin-issuance-description {
  max-width: 60ch;
  margin: 0 0 14px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--text-muted);
}

.admin-action-btn-danger {
  color: #ff6b6b;
  border-color: rgba(255, 107, 107, 0.35);
}

.admin-action-btn-danger:hover {
  color: #ff6b6b;
  border-color: #ff6b6b;
}

.admin-service-env-list {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.admin-service-env-controls {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: stretch;
}

.admin-btn-row {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
}

.admin-btn-row .admin-action-btn {
  width: 100%;
}
