/*
 * SympWatch — User Portal Design System
 * Modern 2025-2026 UX · Fluid Layout · Mobile-First
 * ISO/IEC 25010 Compliance · ISO/IEC 25002 Quality
 * Liquid Design with Dynamic Fluid Layout
 */

/* ============================================================
 * 1. FLUID TYPOGRAPHY — clamp() for seamless scaling
 *    ISO/IEC 25010 — Adaptability: text scales fluidly across
 *    all viewport widths without jarring breakpoint jumps.
 *    ISO/IEC 25002 — Satisfaction: reading comfort at every size.
 * ============================================================ */
.up-portal {
  --up-text-xs:   clamp(0.6875rem, 0.65rem + 0.15vw, 0.75rem);
  --up-text-sm:   clamp(0.8125rem, 0.78rem + 0.15vw, 0.875rem);
  --up-text-base: clamp(0.9375rem, 0.9rem + 0.18vw, 1rem);
  --up-text-lg:   clamp(1.0625rem, 1rem + 0.25vw, 1.125rem);
  --up-text-xl:   clamp(1.25rem, 1.1rem + 0.5vw, 1.5rem);
  --up-text-2xl:  clamp(1.5rem, 1.25rem + 0.8vw, 1.875rem);
  --up-text-3xl:  clamp(1.75rem, 1.4rem + 1.2vw, 2.375rem);

  /* Fluid spacing */
  --up-gap-xs:  clamp(0.25rem, 0.2rem + 0.2vw, 0.375rem);
  --up-gap-sm:  clamp(0.5rem, 0.4rem + 0.3vw, 0.75rem);
  --up-gap-md:  clamp(0.75rem, 0.6rem + 0.5vw, 1.25rem);
  --up-gap-lg:  clamp(1rem, 0.8rem + 0.7vw, 1.75rem);
  --up-gap-xl:  clamp(1.5rem, 1.1rem + 1.2vw, 2.5rem);
  --up-gap-2xl: clamp(2rem, 1.5rem + 1.5vw, 3.5rem);

  /* Container fluid widths */
  --up-container-max: min(1280px, 100% - clamp(1rem, 0.5rem + 2vw, 4rem));

  /* Card styling */
  --up-card-radius: clamp(0.75rem, 0.6rem + 0.5vw, 1.25rem);
  --up-card-padding: clamp(1rem, 0.75rem + 0.8vw, 1.75rem);
  --up-card-shadow: 0 1px 3px rgba(15, 22, 48, 0.04), 0 4px 14px rgba(15, 22, 48, 0.06);
  --up-card-shadow-hover: 0 2px 6px rgba(15, 22, 48, 0.06), 0 8px 24px rgba(15, 22, 48, 0.08);
  --up-card-border: 1px solid var(--neutral-100, #e8eaf3);

  /* Interactive feedback */
  --up-focus-ring: 0 0 0 3px rgba(29, 70, 214, 0.18);
  --up-transition: 180ms cubic-bezier(0.4, 0, 0.2, 1);

  font-size: var(--up-text-base);
  line-height: 1.55;
}

/* ============================================================
 * 2. FLUID CONTAINER — Liquid layout foundation
 *    ISO/IEC 25010 — Adaptability: container width and padding
 *    scale proportionally to viewport.
 *    ISO/IEC 25002 — Efficiency: optimal reading width maintained.
 * ============================================================ */
.up-portal .container,
.up-container {
  width: 100%;
  max-width: var(--up-container-max);
  margin-inline: auto;
  padding-inline: clamp(1rem, 0.5rem + 2vw, 2rem);
}

/* ============================================================
 * 3. NAVBAR ENHANCEMENTS — Consistent, accessible navigation
 *    ISO/IEC 25010 — Operability: clear navigation hierarchy.
 *    ISO/IEC 25002 — Learnability: familiar patterns from other sites.
 * ============================================================ */

/* Navbar fluid spacing */
/* ── Slim Top Navigation Bar ─────────────────────────────────
 *  ISO/IEC 25010 — Operability (Navigability): compact navbar maximises
 *      content viewport while keeping navigation accessible within
 *      comfortable touch-target bounds (min 44 px per WCAG 2.5.8).
 *  ISO/IEC 25010 — Appropriateness Recognizability: reduced visual weight
 *      keeps user focus on primary page content rather than the chrome.
 *  ISO/IEC 25010 — User Interface Aesthetics: slim proportions follow
 *      modern SaaS/dashboard conventions — dense but not cramped.
 *  ISO/IEC 25002 — Efficiency: less vertical space consumed by navigation
 *      means more data visible per scroll, improving task throughput.
 *  ISO/IEC 25002 — Satisfaction: clean, minimal header conveys a polished,
 *      professional aesthetic.
 * ──────────────────────────────────────────────────────────── */
.up-portal .sw-navbar {
  position: sticky;
  top: 0;
  z-index: 1020;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.up-portal .sw-navbar-inner {
  height: clamp(42px, 40px + 0.5vw, 48px);
  padding-block: 0;
  gap: var(--space-2, 0.5rem);
}

.up-portal .sw-navbar-brand {
  gap: clamp(0.3rem, 0.25rem + 0.15vw, 0.5rem);
}

.up-portal .sw-navbar-brand-icon {
  width: clamp(24px, 22px + 0.4vw, 28px);
  height: clamp(24px, 22px + 0.4vw, 28px);
  border-radius: var(--radius-md, 0.5rem);
}

.up-portal .sw-navbar-brand-icon svg {
  width: 14px;
  height: 14px;
}

.up-portal .sw-navbar-brand-text {
  font-size: clamp(0.8125rem, 0.78rem + 0.15vw, 0.9375rem);
  font-weight: 700;
  letter-spacing: -0.01em;
}

.up-portal .sw-navbar-brand-sub {
  font-size: clamp(0.5625rem, 0.54rem + 0.1vw, 0.6875rem);
  opacity: 0.7;
  margin-left: var(--space-1, 0.25rem);
  padding-left: var(--space-1, 0.25rem);
}

/* Desktop nav links — compact pill buttons */
.up-portal .sw-nav-links {
  gap: 1px;
}

.up-portal .sw-nav-links .sw-nav-link {
  padding: 4px 10px;
  font-size: clamp(0.6875rem, 0.66rem + 0.12vw, 0.8125rem);
  gap: var(--space-1, 0.25rem);
}

.up-portal .sw-nav-links .sw-nav-link svg {
  width: 13px;
  height: 13px;
}

.up-portal .sw-nav-links .sw-nav-link--active::after {
  bottom: -2px;
  width: 18px;
  height: 1.5px;
}

.up-portal .sw-nav-links .sw-nav-link--signout {
  margin-left: var(--space-1, 0.25rem);
  padding-left: var(--space-2, 0.5rem);
}

/* Hamburger — scaled to match slim bar */
.up-portal .sw-nav-hamburger {
  width: 36px;
  height: 36px;
  min-width: 36px;
  min-height: 36px;
}

.up-portal .sw-nav-hamburger svg {
  width: 18px;
  height: 18px;
}

/* Mobile nav overlay enhancement */
.up-portal .sw-nav-mobile {
  padding: var(--up-gap-md);
  gap: var(--up-gap-xs);
}

.up-portal .sw-nav-mobile .sw-nav-link {
  padding: var(--up-gap-sm) var(--up-gap-md);
  border-radius: var(--radius-lg, 0.75rem);
  font-size: var(--up-text-sm);
}

.up-portal .sw-nav-mobile .sw-nav-link:hover,
.up-portal .sw-nav-mobile .sw-nav-link:focus-visible {
  background: rgba(255, 255, 255, 0.12);
}

/* Responsive — slightly taller on wider viewports for comfort */
@media (min-width: 768px) {
  .up-portal .sw-navbar-inner {
    height: clamp(46px, 44px + 0.4vw, 52px);
  }
}

/* ============================================================
 * 4. PAGE HEADER — Fluid, balanced hero section
 *    ISO/IEC 25010 — Identifiability: clear page context.
 *    ISO/IEC 25002 — Clarity: user immediately knows where they are.
 * ============================================================ */
.up-portal .sw-pheader {
  padding-block: clamp(1.25rem, 1rem + 1vw, 2rem);
}

.up-portal .sw-pheader-title {
  font-size: var(--up-text-2xl);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.up-portal .sw-pheader-sub {
  font-size: var(--up-text-sm);
  margin-top: var(--up-gap-xs);
  opacity: 0.85;
}

.up-portal .sw-pheader-eyebrow {
  font-size: var(--up-text-xs);
  margin-bottom: var(--up-gap-xs);
}

/* ============================================================
 * 5. ACTION CARDS — Bento-style grid layout
 *    ISO/IEC 25010 — Operability: primary actions are visually
 *    prominent and easily tappable.
 *    ISO/IEC 25002 — Effectiveness: one-tap access to core tasks.
 * ============================================================ */
.up-portal .sw-action-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 140px), 1fr));
  gap: var(--up-gap-md);
}

@media (min-width: 480px) {
  .up-portal .sw-action-grid {
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  }
}

@media (min-width: 768px) {
  .up-portal .sw-action-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

.up-portal .sw-action-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--up-gap-sm);
  padding: clamp(1rem, 0.8rem + 0.6vw, 1.5rem);
  border-radius: var(--up-card-radius);
  background: var(--neutral-0, #fff);
  border: var(--up-card-border);
  box-shadow: var(--up-card-shadow);
  text-align: center;
  transition: box-shadow var(--up-transition), transform var(--up-transition), border-color var(--up-transition);
  cursor: pointer;
  text-decoration: none;
  color: inherit;
  min-height: 0;
  position: relative;
  overflow: hidden;
}

.up-portal .sw-action-card:hover {
  box-shadow: var(--up-card-shadow-hover);
  transform: translateY(-1px);
  border-color: var(--primary-200, #b8cbfb);
}

.up-portal .sw-action-card:focus-visible {
  outline: none;
  box-shadow: var(--up-focus-ring);
  border-color: var(--primary-400, #537df2);
}

.up-portal .sw-action-card:active {
  transform: translateY(0);
}

.up-portal .sw-action-card-icon {
  width: clamp(40px, 36px + 1vw, 52px);
  height: clamp(40px, 36px + 1vw, 52px);
  border-radius: clamp(10px, 8px + 0.5vw, 14px);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.up-portal .sw-action-card-icon svg {
  width: clamp(20px, 18px + 0.5vw, 24px);
  height: clamp(20px, 18px + 0.5vw, 24px);
}

.up-portal .sw-action-card-label {
  font-size: var(--up-text-xs);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 600;
  color: var(--neutral-400, #8390ba);
}

.up-portal .sw-action-card-title {
  font-size: var(--up-text-sm);
  font-weight: 700;
  color: var(--neutral-800, #1c254a);
  line-height: 1.3;
}

/* ============================================================
 * 6. CARDS — Modern card components
 *    ISO/IEC 25010 — Appropriateness Recognizability: chunked
 *    content in visually distinct containers.
 *    ISO/IEC 25002 — Clarity: clear content boundaries.
 * ============================================================ */
.up-portal .card {
  border-radius: var(--up-card-radius);
  border: var(--up-card-border);
  box-shadow: var(--up-card-shadow);
  overflow: hidden;
  background: var(--neutral-0, #fff);
}

.up-portal .card-header {
  padding: clamp(0.875rem, 0.7rem + 0.5vw, 1.25rem) var(--up-card-padding);
  font-size: var(--up-text-sm);
}

.up-portal .card-header h5 {
  font-size: var(--up-text-base);
  font-weight: 700;
}

.up-portal .card-body {
  padding: var(--up-card-padding);
}

.up-portal .card-footer {
  padding: clamp(0.75rem, 0.6rem + 0.4vw, 1rem) var(--up-card-padding);
  font-size: var(--up-text-xs);
}

/* Map container fluid height */
.up-portal #map {
  height: clamp(280px, 250px + 10vw, 480px);
  width: 100%;
}

/* ============================================================
 * 7. SURVEILLANCE MAP — Fluid responsive map section
 *    ISO/IEC 25010 — Operability: map adapts to screen size.
 *    ISO/IEC 25002 — Effectiveness: map data visible at all sizes.
 * ============================================================ */
.up-portal .time-selector {
  font-size: var(--up-text-sm);
  padding: clamp(0.375rem, 0.3rem + 0.2vw, 0.5rem) clamp(0.5rem, 0.4rem + 0.3vw, 0.75rem);
  border-radius: var(--radius-md, 0.5rem);
}

.up-portal .legend-item {
  font-size: var(--up-text-xs);
  gap: clamp(4px, 3px + 0.2vw, 8px);
}

.up-portal .legend-color {
  width: clamp(10px, 9px + 0.2vw, 14px);
  height: clamp(10px, 9px + 0.2vw, 14px);
  border-radius: 3px;
}

/* ============================================================
 * 8. ALERTS & NOTICES — Clear visual hierarchy
 *    ISO/IEC 25010 — User Error Protection: clear status communication.
 *    ISO/IEC 25002 — Transparency: user understands system state.
 * ============================================================ */
.up-portal .alert {
  padding: var(--up-gap-md);
  border-radius: var(--up-card-radius);
  font-size: var(--up-text-sm);
  line-height: 1.55;
}

.up-portal .ev-restrict-notice {
  padding: var(--up-gap-md) var(--up-gap-lg);
  border-radius: var(--up-card-radius);
  gap: var(--up-gap-md);
}

.up-portal .ev-restrict-title {
  font-size: var(--up-text-sm);
}

.up-portal .ev-restrict-desc {
  font-size: var(--up-text-xs);
}

.up-portal .ev-restrict-list {
  gap: var(--up-gap-xs) var(--up-gap-md);
}

.up-portal .ev-restrict-list li {
  font-size: var(--up-text-xs);
}

/* ============================================================
 * 9. FORMS — Accessible, touch-friendly inputs
 *    ISO/IEC 25010 — Operability: inputs are sized for touch (44px min).
 *    ISO/IEC 25002 — Efficiency: clear labels, appropriate spacing.
 * ============================================================ */
.up-portal .form-control {
  padding: clamp(0.625rem, 0.55rem + 0.25vw, 0.75rem) clamp(0.75rem, 0.65rem + 0.3vw, 1rem);
  font-size: var(--up-text-base);
  border-radius: var(--radius-lg, 0.75rem);
  min-height: 44px; /* Touch target minimum — ISO/IEC 25010 */
  transition: border-color var(--up-transition), box-shadow var(--up-transition);
}

.up-portal .form-control:focus {
  border-color: var(--primary-400, #537df2);
  box-shadow: var(--up-focus-ring);
  outline: none;
}

.up-portal .form-label {
  font-size: var(--up-text-sm);
  font-weight: 600;
  color: var(--neutral-700, #2e3864);
  margin-bottom: var(--up-gap-xs);
}

.up-portal .form-group {
  margin-bottom: var(--up-gap-md);
}

/* ============================================================
 * 10. BUTTONS — Touch-optimized, clear hierarchy
 *     ISO/IEC 25010 — Operability: 44px min touch targets.
 *     ISO/IEC 25002 — Efficiency: clear primary/secondary distinction.
 * ============================================================ */
.up-portal .btn {
  min-height: 44px;
  padding: clamp(0.5rem, 0.45rem + 0.2vw, 0.75rem) clamp(1rem, 0.8rem + 0.5vw, 1.5rem);
  font-size: var(--up-text-sm);
  font-weight: 600;
  border-radius: var(--radius-lg, 0.75rem);
  transition: all var(--up-transition);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

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

.up-portal .btn-lg {
  min-height: 48px;
  padding: clamp(0.625rem, 0.55rem + 0.25vw, 0.875rem) clamp(1.25rem, 1rem + 0.7vw, 1.75rem);
  font-size: var(--up-text-base);
}

/* ============================================================
 * 11. BOTTOM NAVIGATION — Mobile-optimized tab bar
 *     ISO/IEC 25010 — Operability: persistent mobile nav with
 *     ample touch targets and clear active states.
 *     ISO/IEC 25002 — Effectiveness: one-tap access to all sections.
 * ============================================================ */
.up-portal .sw-bottom-nav {
  padding-bottom: env(safe-area-inset-bottom, 0);
}

.up-portal .sw-bottom-nav-item {
  padding: clamp(6px, 5px + 0.3vw, 10px) clamp(4px, 3px + 0.2vw, 8px);
  font-size: clamp(9px, 8px + 0.2vw, 11px);
  gap: clamp(2px, 1px + 0.15vw, 4px);
  min-width: 0;
  flex: 1;
}

.up-portal .sw-bottom-nav-item svg {
  width: clamp(18px, 16px + 0.5vw, 22px);
  height: clamp(18px, 16px + 0.5vw, 22px);
}

/* ============================================================
 * 12. AUTH PAGES — Clean, centered authentication layouts
 *     ISO/IEC 25010 — Appropriateness Recognizability: familiar
 *     auth pattern with clear visual hierarchy.
 *     ISO/IEC 25002 — Satisfaction: aesthetically pleasing login.
 * ============================================================ */
.up-auth-layout {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: linear-gradient(
    165deg,
    var(--neutral-50, #f3f4f9) 0%,
    var(--surface-1, #f7f8fd) 40%,
    var(--primary-50, #eff3ff) 100%
  );
}

.up-auth-layout .sw-navbar {
  background: linear-gradient(135deg, var(--primary-800, #102c96) 0%, var(--primary-700, #1638b8) 100%);
  /* Override sw-navbar--auth position:absolute from main.css —
     absolute positioning removes the navbar from document flow,
     causing the auth card (and its logo icon) to start at top:0
     and slide behind the navbar.
     sticky keeps the navbar in flow so content starts below it.
     ISO/IEC 25010 — Identifiability: logo icon fully visible.
     ISO/IEC 25002 — Completeness: no content hidden behind navbar. */
  position: sticky;
  top: 0;
  z-index: 1020;
}

/* Override dark-gray text inherited from .sw-navbar--auth (main.css)
   so text is legible against the dark-blue gradient background.
   ISO/IEC 25010 — Operability > User-interface aesthetics & Accessibility:
     white (#fff) on #102c96 yields contrast ratio ≈ 11.3:1,
     exceeding WCAG AAA 7:1 threshold for normal text.
   ISO/IEC 25002 — Satisfaction > Adequacy of text–background contrast:
     measured value (11.3:1) well above the minimum acceptability target. */
.up-auth-layout .sw-navbar .sw-navbar-brand-text {
  color: #fff;
}
.up-auth-layout .sw-navbar .sw-nav-link {
  color: rgba(255, 255, 255, 0.85);
}
.up-auth-layout .sw-navbar .sw-nav-link:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.12);
}
/* Distinguish the brand icon from the similarly-hued navbar gradient.
   ISO/IEC 25010 — Identifiability: icon visually distinct from background.
   ISO/IEC 25002 — Discriminability: perceptible boundary between elements. */
.up-auth-layout .sw-navbar .sw-navbar-brand-icon {
  background: rgba(255, 255, 255, 0.15);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.20);
}

.up-auth-body {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(1.5rem, 1rem + 2vw, 3rem) clamp(1rem, 0.5rem + 2vw, 2rem);
  /* Override sw-auth-main overflow:hidden from main.css — no longer needed
     since ::before/::after pseudo-elements are disabled.
     ISO/IEC 25010 — Identifiability: no unintended content clipping. */
  overflow: visible;
}

.up-auth-card {
  width: 100%;
  max-width: min(460px, 100%);
  background: var(--neutral-0, #fff);
  border-radius: clamp(1rem, 0.8rem + 0.6vw, 1.5rem);
  box-shadow: 0 1px 3px rgba(15, 22, 48, 0.04),
              0 8px 32px rgba(15, 22, 48, 0.08);
  /* NO overflow:hidden — it clips the logo icon at the card top edge.
     Instead, border-radius is applied directly to first/last children.
     ISO/IEC 25010 — Identifiability: all card content fully visible.
     ISO/IEC 25002 — Completeness: no content clipped by container. */
  overflow: visible;
}

.up-auth-header {
  background: linear-gradient(135deg, var(--primary-800, #102c96) 0%, var(--primary-600, #1d46d6) 100%);
  /* 3-value padding: top | left-right | bottom.
     Top padding generous so the logo icon has full breathing room.
     ISO/IEC 25010 — Identifiability: logo icon fully visible at all viewports. */
  padding: clamp(2rem, 1.5rem + 1.5vw, 3rem) clamp(1.25rem, 1rem + 0.8vw, 2rem) clamp(1.25rem, 1rem + 0.8vw, 1.75rem);
  text-align: center;
  color: #fff;
  overflow: visible;
  /* Match card's top border-radius since card no longer clips with overflow:hidden */
  border-radius: clamp(1rem, 0.8rem + 0.6vw, 1.5rem) clamp(1rem, 0.8rem + 0.6vw, 1.5rem) 0 0;
}

.up-auth-logo {
  width: clamp(48px, 44px + 1vw, 60px);
  height: clamp(48px, 44px + 1vw, 60px);
  border-radius: clamp(12px, 10px + 0.5vw, 16px);
  background: rgba(255, 255, 255, 0.18);
  border: 1.5px solid rgba(255, 255, 255, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto clamp(0.75rem, 0.6rem + 0.4vw, 1.25rem);
  /* Override sw-auth-logo backdrop-filter from main.css — can cause
     rendering artifacts that visually clip the icon on some browsers.
     ISO/IEC 25010 — Identifiability: icon always fully rendered. */
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  overflow: visible;
  flex-shrink: 0;
}

.up-auth-badge {
  display: inline-block;
  font-size: var(--up-text-xs);
  font-weight: 600;
  padding: 0.2rem 0.75rem;
  border-radius: var(--radius-full, 9999px);
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: rgba(255, 255, 255, 0.9);
  margin-bottom: var(--up-gap-sm);
  letter-spacing: 0.02em;
}

.up-auth-header h1 {
  font-size: var(--up-text-xl);
  font-weight: 700;
  color: #fff;
  margin: 0 0 var(--up-gap-xs);
  letter-spacing: -0.01em;
}

.up-auth-header p {
  font-size: var(--up-text-sm);
  color: rgba(255, 255, 255, 0.75);
  margin: 0;
}

.up-auth-form {
  padding: clamp(1.25rem, 1rem + 0.8vw, 2rem);
}

/* Card's last child always gets bottom border-radius to match the card shape.
   Without overflow:hidden on the card, children must handle their own radius.
   ISO/IEC 25010 — Operability: consistent card appearance across all auth pages. */
.up-auth-card > :last-child {
  border-radius: 0 0 clamp(1rem, 0.8rem + 0.6vw, 1.5rem) clamp(1rem, 0.8rem + 0.6vw, 1.5rem);
}

.up-auth-footer {
  text-align: center;
  padding: clamp(1rem, 0.8rem + 0.5vw, 1.5rem);
  border-top: 1px solid var(--neutral-100, #e8eaf3);
  font-size: var(--up-text-sm);
  color: var(--neutral-500, #5c6a96);
  background: var(--neutral-25, #f9fafd);
}

.up-auth-footer a {
  font-weight: 600;
  color: var(--primary-600, #1d46d6);
}

.up-auth-footer a:hover {
  color: var(--primary-700, #1638b8);
  text-decoration: underline;
}

/* ============================================================
 * 13. STATUS/FEEDBACK PAGES — Success, cooldown, confirmation
 *     ISO/IEC 25010 — Appropriateness Recognizability: clear
 *     success/warning/info states.
 *     ISO/IEC 25002 — Satisfaction: positive peak-end experience.
 * ============================================================ */
.up-status-page {
  min-height: calc(100vh - 64px);
  min-height: calc(100dvh - 64px);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: clamp(2rem, 1.5rem + 2vw, 4rem) clamp(1rem, 0.5rem + 2vw, 2rem);
}

.up-status-card {
  width: 100%;
  max-width: min(580px, 100%);
  background: var(--neutral-0, #fff);
  border-radius: var(--up-card-radius);
  box-shadow: var(--up-card-shadow);
  border: var(--up-card-border);
  overflow: hidden;
}

.up-status-body {
  padding: clamp(1.5rem, 1.2rem + 1vw, 2.5rem);
  text-align: center;
}

.up-status-icon {
  width: clamp(56px, 52px + 1vw, 72px);
  height: clamp(56px, 52px + 1vw, 72px);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto clamp(1rem, 0.8rem + 0.5vw, 1.5rem);
}

.up-status-icon--success {
  background: var(--success-light, #ecfdf5);
}

.up-status-icon--warning {
  background: var(--warning-light, #fffbeb);
}

.up-status-icon--info {
  background: var(--info-light, #eff3ff);
}

.up-status-icon svg {
  width: clamp(28px, 26px + 0.5vw, 36px);
  height: clamp(28px, 26px + 0.5vw, 36px);
}

.up-status-body h2 {
  font-size: var(--up-text-xl);
  font-weight: 700;
  color: var(--neutral-800, #1c254a);
  margin: 0 0 var(--up-gap-sm);
}

.up-status-body p {
  font-size: var(--up-text-sm);
  color: var(--neutral-500, #5c6a96);
  line-height: 1.6;
  margin: 0 0 var(--up-gap-lg);
}

.up-status-detail {
  background: var(--neutral-50, #f3f4f9);
  border-radius: var(--up-card-radius);
  border: 1px solid var(--neutral-200, #d0d4e8);
  padding: var(--up-gap-md);
  margin-bottom: var(--up-gap-lg);
}

.up-status-detail-label {
  font-size: var(--up-text-xs);
  color: var(--neutral-500, #5c6a96);
  margin-bottom: var(--up-gap-xs);
  font-weight: 500;
}

.up-status-detail-value {
  font-size: var(--up-text-xl);
  font-weight: 700;
  color: var(--primary-700, #1638b8);
  font-family: var(--font-mono);
  word-break: break-all;
}

.up-status-info {
  text-align: left;
  background: var(--neutral-25, #f9fafd);
  border: 1px solid var(--neutral-100, #e8eaf3);
  border-radius: var(--up-card-radius);
  padding: var(--up-gap-md);
  margin-bottom: var(--up-gap-lg);
}

.up-status-info strong {
  display: block;
  font-size: var(--up-text-sm);
  font-weight: 700;
  color: var(--neutral-700, #2e3864);
  margin-bottom: var(--up-gap-xs);
}

.up-status-info p {
  font-size: var(--up-text-xs);
  color: var(--neutral-600, #43507c);
  margin: 0;
  line-height: 1.65;
}

.up-status-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--up-gap-sm);
  justify-content: center;
}

/* ============================================================
 * 14. SLIDE-OUT PANELS — Profile & Family Members
 *     ISO/IEC 25010 — Operability: context-preserving panel UI.
 *     ISO/IEC 25002 — Effectiveness: no page navigation needed.
 * ============================================================ */
.up-portal .fm-panel,
.up-portal .prof-panel {
  border-radius: var(--up-card-radius) 0 0 var(--up-card-radius);
}

@media (max-width: 575px) {
  .up-portal .fm-panel,
  .up-portal .prof-panel {
    border-radius: 0;
  }
}

.up-portal .fm-panel-header,
.up-portal .fm-panel-footer {
  padding: clamp(0.875rem, 0.7rem + 0.4vw, 1.25rem) clamp(1rem, 0.8rem + 0.5vw, 1.5rem);
}

.up-portal .fm-panel-body {
  padding: clamp(1rem, 0.8rem + 0.5vw, 1.5rem);
}

.up-portal .fm-card {
  padding: clamp(0.75rem, 0.6rem + 0.4vw, 1.25rem);
  border-radius: var(--up-card-radius);
  margin-bottom: var(--up-gap-sm);
}

.up-portal .fm-card-name {
  font-size: var(--up-text-sm);
}

.up-portal .fm-card-field {
  font-size: var(--up-text-xs);
}

/* ============================================================
 * 15. INFO BOXES & CONTENT CHUNKS
 *     ISO/IEC 25010 — Appropriateness Recognizability: clear
 *     informational sections with visual distinction.
 *     ISO/IEC 25002 — Learnability: structured info aids comprehension.
 * ============================================================ */
.up-portal .info-box {
  border-radius: var(--up-card-radius);
  padding: var(--up-gap-md);
  font-size: var(--up-text-sm);
}

/* ============================================================
 * 16. TABLES — Responsive data display
 *     ISO/IEC 25010 — Operability: data tables work on mobile.
 *     ISO/IEC 25002 — Efficiency: quick data scanning.
 * ============================================================ */
.up-portal .table-responsive {
  border-radius: var(--up-card-radius);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.up-portal .table th {
  font-size: var(--up-text-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--neutral-500, #5c6a96);
  padding: var(--up-gap-sm) var(--up-gap-md);
  white-space: nowrap;
}

.up-portal .table td {
  font-size: var(--up-text-sm);
  padding: var(--up-gap-sm) var(--up-gap-md);
  vertical-align: middle;
}

/* ============================================================
 * 17. BARANGAY INFO PANEL — Map interactivity
 *     ISO/IEC 25010 — Operability: slide-up panel for mobile.
 *     ISO/IEC 25002 — Effectiveness: in-context health data.
 * ============================================================ */
.up-portal .bi-panel {
  border-radius: var(--up-card-radius) var(--up-card-radius) 0 0;
}

.up-portal .bi-panel-header {
  padding: clamp(0.875rem, 0.7rem + 0.4vw, 1.25rem) var(--up-gap-lg);
}

.up-portal .bi-panel-body {
  padding: var(--up-gap-md) var(--up-gap-lg);
  font-size: var(--up-text-sm);
}

/* ============================================================
 * 18. MODALS — Responsive dialog containers
 *     ISO/IEC 25010 — Operability: modals adapt to viewport.
 *     ISO/IEC 25002 — Satisfaction: no content overflow on mobile.
 * ============================================================ */
.up-portal .chn-modal,
.up-portal .ann-modal {
  border-radius: var(--up-card-radius);
  max-height: min(90vh, 90dvh);
}

@media (max-width: 575px) {
  .up-portal .chn-modal,
  .up-portal .ann-modal {
    margin: var(--up-gap-sm);
    border-radius: var(--up-card-radius);
  }
}

.up-portal .chn-section {
  padding: var(--up-gap-md);
  border-radius: var(--radius-lg, 0.75rem);
  margin-bottom: var(--up-gap-sm);
}

.up-portal .chn-section-title {
  font-size: var(--up-text-sm);
  font-weight: 700;
}

.up-portal .chn-section-body {
  font-size: var(--up-text-sm);
  line-height: 1.65;
}

/* ============================================================
 * 19. BADGES — Compact status indicators
 *     ISO/IEC 25010 — Identifiability: quick status recognition.
 *     ISO/IEC 25002 — Clarity: status is unambiguous.
 * ============================================================ */
.up-portal .badge {
  font-size: var(--up-text-xs);
  padding: clamp(0.15rem, 0.1rem + 0.1vw, 0.25rem) clamp(0.4rem, 0.35rem + 0.15vw, 0.625rem);
  border-radius: var(--radius-full, 9999px);
  font-weight: 600;
  letter-spacing: 0.01em;
}

/* ============================================================
 * 20. ANNOUNCEMENT CARDS — Content discovery
 *     ISO/IEC 25010 — Appropriateness Recognizability: severity
 *     is immediately apparent through color coding.
 *     ISO/IEC 25002 — Effectiveness: most important info first.
 * ============================================================ */
.up-ann-grid {
  display: grid;
  gap: var(--up-gap-md);
}

.up-ann-card {
  background: var(--neutral-0, #fff);
  border-radius: var(--up-card-radius);
  border: var(--up-card-border);
  box-shadow: var(--up-card-shadow);
  padding: var(--up-card-padding);
  transition: box-shadow var(--up-transition), border-color var(--up-transition);
}

.up-ann-card:hover {
  box-shadow: var(--up-card-shadow-hover);
}

.up-ann-card-header {
  display: flex;
  align-items: flex-start;
  gap: var(--up-gap-md);
  margin-bottom: var(--up-gap-md);
}

.up-ann-card-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.up-ann-card-meta {
  flex: 1;
  min-width: 0;
}

.up-ann-card-title {
  font-size: var(--up-text-base);
  font-weight: 700;
  color: var(--neutral-800, #1c254a);
  margin: 0 0 var(--up-gap-xs);
  line-height: 1.3;
}

.up-ann-card-date {
  font-size: var(--up-text-xs);
  color: var(--neutral-400, #8390ba);
}

.up-ann-card-body {
  font-size: var(--up-text-sm);
  color: var(--neutral-600, #43507c);
  line-height: 1.65;
}

/* ============================================================
 * 21. REPORT CARDS — My Reports list items
 *     ISO/IEC 25010 — Appropriateness: report cards show key info.
 *     ISO/IEC 25002 — Efficiency: scannable report history.
 * ============================================================ */
.up-report-list {
  display: grid;
  gap: var(--up-gap-sm);
}

.up-report-card {
  background: var(--neutral-0, #fff);
  border-radius: var(--up-card-radius);
  border: var(--up-card-border);
  box-shadow: var(--up-card-shadow);
  padding: var(--up-card-padding);
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: var(--up-gap-md);
  align-items: center;
  transition: box-shadow var(--up-transition), border-color var(--up-transition);
  cursor: pointer;
  text-decoration: none;
  color: inherit;
}

.up-report-card:hover {
  box-shadow: var(--up-card-shadow-hover);
  border-color: var(--primary-200, #b8cbfb);
}

@media (max-width: 575px) {
  .up-report-card {
    grid-template-columns: 1fr;
    gap: var(--up-gap-sm);
  }
}

.up-report-card-status {
  width: clamp(36px, 32px + 1vw, 44px);
  height: clamp(36px, 32px + 1vw, 44px);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.up-report-card-status--active {
  background: var(--warning-light, #fffbeb);
  color: var(--warning, #d97706);
}

.up-report-card-status--cleared {
  background: var(--success-light, #ecfdf5);
  color: var(--success, #059669);
}

.up-report-card-info {
  min-width: 0;
}

.up-report-card-symptoms {
  display: flex;
  flex-wrap: wrap;
  gap: var(--up-gap-xs);
  margin-bottom: var(--up-gap-xs);
}

.up-report-card-symptom {
  font-size: var(--up-text-xs);
  font-weight: 600;
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius-full, 9999px);
  background: var(--primary-50, #eff3ff);
  color: var(--primary-700, #1638b8);
}

.up-report-card-date {
  font-size: var(--up-text-xs);
  color: var(--neutral-400, #8390ba);
}

.up-report-card-arrow {
  color: var(--neutral-300, #adb4d4);
  flex-shrink: 0;
}

/* ============================================================
 * 22. REGISTRATION FORM — Chunked multi-section form
 *     ISO/IEC 25010 — Operability: form sections reduce cognitive load.
 *     ISO/IEC 25002 — Efficiency: progressive disclosure of fields.
 * ============================================================ */
.up-reg-section {
  margin-bottom: var(--up-gap-xl);
  padding-bottom: var(--up-gap-lg);
  border-bottom: 1px solid var(--neutral-100, #e8eaf3);
}

.up-reg-section:last-of-type {
  border-bottom: none;
  margin-bottom: var(--up-gap-md);
  padding-bottom: 0;
}

.up-reg-section-header {
  display: flex;
  align-items: center;
  gap: var(--up-gap-sm);
  margin-bottom: var(--up-gap-md);
}

.up-reg-section-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: var(--primary-50, #eff3ff);
  color: var(--primary-600, #1d46d6);
}

.up-reg-section-title {
  font-size: var(--up-text-base);
  font-weight: 700;
  color: var(--neutral-800, #1c254a);
  margin: 0;
}

.up-reg-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr));
  gap: var(--up-gap-md);
}

@media (min-width: 768px) {
  .up-reg-grid {
    grid-template-columns: 1fr 1fr;
  }
}

.up-reg-full {
  grid-column: 1 / -1;
}

/* ============================================================
 * 23. REPORT FORM — Symptom reporting UX
 *     ISO/IEC 25010 — Functional Suitability: form captures
 *     all required data with clear validation.
 *     ISO/IEC 25002 — Effectiveness: fast symptom reporting flow.
 * ============================================================ */
.up-symptom-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 200px), 1fr));
  gap: var(--up-gap-sm);
}

.up-symptom-chip {
  display: flex;
  align-items: center;
  gap: var(--up-gap-sm);
  padding: var(--up-gap-sm) var(--up-gap-md);
  border: 2px solid var(--neutral-200, #d0d4e8);
  border-radius: var(--up-card-radius);
  background: var(--neutral-0, #fff);
  cursor: pointer;
  transition: all var(--up-transition);
  min-height: 48px;
  font-size: var(--up-text-sm);
  font-weight: 500;
  color: var(--neutral-700, #2e3864);
}

.up-symptom-chip:hover {
  border-color: var(--primary-300, #86a5f7);
  background: var(--primary-50, #eff3ff);
}

.up-symptom-chip.selected {
  border-color: var(--primary-600, #1d46d6);
  background: var(--primary-50, #eff3ff);
  color: var(--primary-700, #1638b8);
  font-weight: 600;
}

.up-symptom-chip.selected .up-symptom-check {
  background: var(--primary-600, #1d46d6);
  border-color: var(--primary-600, #1d46d6);
  color: #fff;
}

.up-symptom-check {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  border: 2px solid var(--neutral-300, #adb4d4);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all var(--up-transition);
}

/* ============================================================
 * 24. PROFILE PANEL — Enhanced hero and info sections
 *     ISO/IEC 25010 — Identifiability: personalized panel header.
 *     ISO/IEC 25002 — Clarity: user knows whose profile is shown.
 * ============================================================ */
.up-portal .prof-hero {
  padding: clamp(1rem, 0.8rem + 0.6vw, 1.5rem);
}

.up-portal .prof-hero-name {
  font-size: var(--up-text-base);
}

.up-portal .prof-hero-loc {
  font-size: var(--up-text-xs);
}

.up-portal .sw-info-grid {
  gap: var(--up-gap-md);
}

.up-portal .sw-info-label {
  font-size: var(--up-text-xs);
}

.up-portal .sw-info-value {
  font-size: var(--up-text-sm);
}

/* ============================================================
 * 24b. SECURITY ZONE — Change Password Section
 *      ISO/IEC 25010 — Security (Confidentiality): in-profile
 *          password management enables credential rotation.
 *      ISO/IEC 25010 — Operability: accessible inline, no navigation.
 *      ISO/IEC 25010 — User Error Protection: real-time strength
 *          and match feedback prevents weak or mistyped passwords.
 *      ISO/IEC 25002 — Accountability: password change invalidates
 *          all sessions, traceable via session-token wipe.
 *      ISO/IEC 25002 — Transparency: clear feedback at every step.
 *      Fluid Layout / Liquid Design: all sizing uses clamp(),
 *          CSS custom properties, and relative units.
 * ============================================================ */
.sw-security-zone {
  margin-top: var(--up-gap-xl, 1.5rem);
  border: 1px solid var(--neutral-200, #d1d5e8);
  border-radius: var(--up-card-radius, 0.75rem);
  background: var(--neutral-0, #fff);
  overflow: hidden;
}
.sw-security-zone-header {
  display: flex;
  align-items: center;
  gap: clamp(0.375rem, 0.3rem + 0.2vw, 0.5rem);
  padding: clamp(0.625rem, 0.5rem + 0.4vw, 0.875rem) clamp(0.75rem, 0.6rem + 0.5vw, 1.25rem);
  background: var(--neutral-50, #f8f9fc);
  border-bottom: 1px solid var(--neutral-200, #d1d5e8);
}
.sw-security-zone-icon {
  color: var(--neutral-600, #505a7e);
  flex-shrink: 0;
  width: 16px;
  height: 16px;
}
.sw-security-zone-title {
  font-size: var(--up-text-sm, 0.875rem);
  font-weight: 700;
  color: var(--neutral-700, #3a4264);
  letter-spacing: 0.02em;
}
.sw-security-zone-body {
  padding: clamp(0.75rem, 0.6rem + 0.5vw, 1.25rem);
  display: flex;
  flex-direction: column;
  gap: clamp(0.625rem, 0.5rem + 0.4vw, 0.875rem);
}
.sw-security-desc {
  font-size: var(--up-text-xs, 0.75rem);
  color: var(--neutral-600, #505a7e);
  margin: 0;
  line-height: 1.55;
}
/* Trigger button — visible by default, hidden when form opens */
.sw-security-trigger {
  display: inline-flex;
  align-items: center;
  gap: clamp(0.3rem, 0.25rem + 0.15vw, 0.5rem);
  padding: clamp(0.4rem, 0.35rem + 0.15vw, 0.5rem) clamp(0.75rem, 0.6rem + 0.4vw, 1rem);
  font-size: var(--up-text-sm, 0.875rem);
  font-weight: 600;
  color: var(--primary-700, #1638b8);
  background: var(--neutral-0, #fff);
  border: 1.5px solid var(--primary-200, #b8cbfb);
  border-radius: var(--radius-lg, 0.75rem);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
  width: 100%;
  justify-content: center;
}
.sw-security-trigger:hover,
.sw-security-trigger:focus-visible {
  background: var(--primary-50, #eff3fe);
  border-color: var(--primary-400, #537df2);
  color: var(--primary-800, #1e3a8a);
  outline: none;
}
/* Change password form */
.sw-changepw-form {
  display: flex;
  flex-direction: column;
  gap: clamp(0.625rem, 0.5rem + 0.4vw, 0.875rem);
}
.sw-changepw-field {
  display: flex;
  flex-direction: column;
  gap: clamp(0.2rem, 0.15rem + 0.1vw, 0.3rem);
}
.sw-changepw-field .form-label {
  font-size: var(--up-text-xs, 0.75rem);
  font-weight: 600;
  color: var(--neutral-600, #505a7e);
}
.sw-changepw-input-row {
  display: flex;
  align-items: center;
  position: relative;
}
.sw-changepw-input-row .form-control {
  flex: 1;
  min-width: 0;
  padding-right: 2.75rem;
}
.sw-changepw-input-row .form-control:focus {
  border-color: var(--primary-400, #537df2);
  box-shadow: var(--up-focus-ring, 0 0 0 3px rgba(29, 70, 214, 0.18));
}
.sw-changepw-input-row .sw-pw-toggle {
  position: absolute;
  right: 0.5rem;
  top: 50%;
  transform: translateY(-50%);
}
/* Strength indicator — ISO/IEC 25010 User Error Protection */
.sw-changepw-strength {
  display: flex;
  align-items: center;
  gap: clamp(0.375rem, 0.3rem + 0.2vw, 0.5rem);
  margin-top: clamp(0.25rem, 0.2rem + 0.1vw, 0.375rem);
}
.sw-changepw-strength-track {
  flex: 1;
  height: 4px;
  background: var(--neutral-100, #e8eaf3);
  border-radius: 2px;
  overflow: hidden;
}
.sw-changepw-strength-fill {
  height: 100%;
  border-radius: 2px;
  transition: width 0.25s ease, background-color 0.25s ease;
  width: 0;
}
/* Fill bar colors (background-color applied to .sw-changepw-strength-fill) */
.sw-changepw-strength-fill.sw-changepw-strength--weak   { background-color: #ef4444; }
.sw-changepw-strength-fill.sw-changepw-strength--fair    { background-color: #f59e0b; }
.sw-changepw-strength-fill.sw-changepw-strength--good    { background-color: #10b981; }
.sw-changepw-strength-fill.sw-changepw-strength--strong  { background-color: #0d9488; }
/* Label text colors — high-contrast against white/light backgrounds
   ISO/IEC 25010 — Accessibility: WCAG AA contrast ratios (4.5:1+).
   ISO/IEC 25002 — Clarity: strength level immediately legible. */
.sw-changepw-strength-label.sw-changepw-strength--weak   { color: #991b1b; }
.sw-changepw-strength-label.sw-changepw-strength--fair    { color: #92400e; }
.sw-changepw-strength-label.sw-changepw-strength--good    { color: #065f46; }
.sw-changepw-strength-label.sw-changepw-strength--strong  { color: #134e4a; }
.sw-changepw-strength-label {
  font-size: var(--up-text-xs, 0.75rem);
  font-weight: 700;
  white-space: nowrap;
  min-width: 3.25rem;
  text-align: right;
  letter-spacing: 0.01em;
  line-height: 1;
}
/* Match indicator — high-contrast text
   ISO/IEC 25010 — Accessibility: easily legible feedback text.
   ISO/IEC 25002 — Clarity: match status visible at a glance. */
.sw-changepw-match {
  font-size: var(--up-text-xs, 0.75rem);
  font-weight: 700;
  margin-top: clamp(0.125rem, 0.1rem + 0.05vw, 0.25rem);
  letter-spacing: 0.01em;
  line-height: 1.3;
}
.sw-changepw-match--ok {
  color: #065f46;
}
.sw-changepw-match--mismatch {
  color: #991b1b;
}
/* Status message */
.sw-changepw-status {
  font-size: var(--up-text-xs, 0.75rem);
  padding: clamp(0.375rem, 0.3rem + 0.2vw, 0.5rem) clamp(0.5rem, 0.4rem + 0.3vw, 0.75rem);
  border-radius: var(--radius-md, 6px);
  line-height: 1.45;
}
.sw-changepw-status--error {
  background: #fef2f2;
  color: #b91c1c;
  border: 1px solid #fecaca;
}
.sw-changepw-status--success {
  background: #f0fdf4;
  color: #166534;
  border: 1px solid #bbf7d0;
}
/* Action buttons */
.sw-changepw-actions {
  display: flex;
  gap: clamp(0.375rem, 0.3rem + 0.2vw, 0.5rem);
  flex-wrap: wrap;
  align-items: center;
}
.sw-changepw-actions .btn-primary {
  flex: 1;
  min-width: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
}
.sw-changepw-actions .btn-secondary {
  white-space: nowrap;
}

/* Responsive — mobile-first adjustments
   ISO/IEC 25010 — Adaptability: form fields stack fluidly.
   ISO/IEC 25002 — Efficiency: touch-friendly sizing on small screens. */
@media (max-width: 479px) {
  .sw-changepw-actions {
    flex-direction: column;
  }
  .sw-changepw-actions .btn-secondary,
  .sw-changepw-actions .btn-primary {
    width: 100%;
    justify-content: center;
  }
  .sw-changepw-strength {
    flex-wrap: wrap;
  }
}

/* ============================================================
 * 25. DANGER ZONE — Deactivation section
 *     ISO/IEC 25010 — User Error Protection: visually separated.
 *     ISO/IEC 25002 — Transparency: consequences are clear.
 * ============================================================ */
.up-portal .sw-danger-zone {
  border-radius: var(--up-card-radius);
  margin-top: var(--up-gap-xl);
}

/* ============================================================
 * 25a. DELETE ACCOUNT — Nested inside Danger Zone
 *      ISO/IEC 25010 — Security (Non-repudiation): unique ID gate
 *          prevents accidental or unauthorized access to deletion.
 *      ISO/IEC 25010 — User Error Protection: triple-barrier design.
 *      ISO/IEC 25002 — Accountability: deliberate multi-step process.
 *      Fluid Layout: all spacing uses clamp() and CSS variables.
 * ============================================================ */
.sw-delete-inner {
  margin-top: clamp(0.625rem, 0.5rem + 0.4vw, 0.875rem);
}
.sw-delete-inner-divider {
  height: 1px;
  background: #fecaca;
  margin-bottom: clamp(0.75rem, 0.6rem + 0.5vw, 1rem);
}
.sw-delete-gate-desc {
  font-size: var(--up-text-xs, 0.75rem);
  color: #991b1b;
  margin: 0 0 clamp(0.5rem, 0.4rem + 0.3vw, 0.75rem);
  line-height: 1.5;
  font-weight: 500;
}
.sw-delete-gate-field {
  display: flex;
  flex-direction: column;
  gap: clamp(0.2rem, 0.15rem + 0.1vw, 0.3rem);
  margin-bottom: clamp(0.375rem, 0.3rem + 0.2vw, 0.5rem);
}
.sw-delete-gate-field .form-label {
  font-size: var(--up-text-xs, 0.75rem);
  font-weight: 600;
  color: #991b1b;
}
.sw-delete-gate-field .form-control {
  border-color: #fca5a5;
  font-size: var(--up-text-sm, 0.875rem);
}
.sw-delete-gate-field .form-control:focus {
  border-color: #f87171;
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.12);
}
.sw-delete-gate-actions {
  margin-top: clamp(0.375rem, 0.3rem + 0.2vw, 0.5rem);
}

/* ============================================================
 * 25b. DELETE ACCOUNT ZONE — Standalone (legacy) styles retained
 *      for backward compat; also used by nested delete form.
 *      ISO/IEC 25010 — Operability: visually distinct from deactivation.
 *      ISO/IEC 25010 — Security: progressive disclosure with password confirmation.
 *      ISO/IEC 25002 — Transparency: consequences and cancellation path fully visible.
 * ============================================================ */
.sw-delete-zone {
  border: 1px solid #7f1d1d;
  border-radius: var(--up-card-radius, 0.75rem);
  margin-top: var(--up-gap-lg, 1.5rem);
  background: #fef2f2;
  overflow: hidden;
}
.sw-delete-zone-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: clamp(0.625rem, 0.5rem + 0.4vw, 0.875rem) clamp(0.75rem, 0.6rem + 0.5vw, 1.25rem);
  background: #7f1d1d;
  color: #fef2f2;
}
.sw-delete-zone-icon {
  flex-shrink: 0;
  width: 16px;
  height: 16px;
}
.sw-delete-zone-title {
  font-size: var(--up-text-sm, 0.875rem);
  font-weight: 700;
  letter-spacing: 0.02em;
}
.sw-delete-zone-body {
  padding: clamp(0.75rem, 0.6rem + 0.5vw, 1.25rem);
}
.sw-delete-desc {
  font-size: var(--up-text-xs, 0.75rem);
  color: #7f1d1d;
  margin: 0 0 0.625rem;
  line-height: 1.5;
}
.sw-delete-list {
  margin: 0;
  padding: 0 0 0 1.25rem;
  font-size: var(--up-text-xs, 0.75rem);
  color: #991b1b;
  line-height: 1.7;
}
.sw-delete-list li {
  margin-bottom: 0.125rem;
}
.sw-delete-form {
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid #fca5a5;
}
.sw-delete-pw-row {
  display: flex;
  gap: 0.375rem;
  align-items: center;
  margin-top: 0.375rem;
}
.sw-delete-pw-row .form-control {
  flex: 1;
  min-width: 0;
}
.sw-delete-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.75rem;
  flex-wrap: wrap;
}
.sw-btn-delete-account {
  background: #7f1d1d;
  color: #fff;
  border: 1px solid #7f1d1d;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  transition: background 0.15s, border-color 0.15s;
}
.sw-btn-delete-account:hover {
  background: #991b1b;
  border-color: #991b1b;
}
.sw-btn-delete-account:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}
.sw-delete-trigger {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  background: transparent;
  border: 1px solid #991b1b;
  border-radius: var(--radius-md, 6px);
  color: #991b1b;
  font-size: var(--up-text-xs, 0.75rem);
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  width: 100%;
  justify-content: center;
}
.sw-delete-trigger:hover {
  background: #991b1b;
  color: #fff;
}
.sw-delete-status {
  font-size: var(--up-text-xs, 0.75rem);
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius-md, 6px);
  margin-top: 0.5rem;
}
.sw-delete-status--error {
  background: #fee2e2;
  color: #991b1b;
  border: 1px solid #fca5a5;
}
.sw-delete-status--success {
  background: #d1fae5;
  color: #065f46;
  border: 1px solid #6ee7b7;
}

/* Deletion cancelled notice */
.sw-deletion-cancelled-notice {
  background: #d1fae5;
  border: 1px solid #6ee7b7;
  border-radius: var(--up-card-radius, 0.75rem);
  padding: clamp(0.75rem, 0.6rem + 0.5vw, 1rem);
  margin-bottom: var(--up-gap-lg, 1.5rem);
}

/* ============================================================
 * 26. ACCESSIBILITY — Focus states & screen reader support
 *     ISO/IEC 25010 — Accessibility: keyboard navigation support.
 *     ISO/IEC 25002 — Inclusivity: usable by all users.
 * ============================================================ */
.up-portal *:focus-visible {
  outline: 2px solid var(--primary-400, #537df2);
  outline-offset: 2px;
}

.up-portal .skip-link {
  position: absolute;
  top: -100%;
  left: var(--up-gap-md);
  z-index: 9999;
  padding: var(--up-gap-sm) var(--up-gap-md);
  background: var(--primary-600, #1d46d6);
  color: #fff;
  border-radius: 0 0 var(--radius-lg, 0.75rem) var(--radius-lg, 0.75rem);
  font-size: var(--up-text-sm);
  font-weight: 600;
  text-decoration: none;
  transition: top var(--up-transition);
}

.up-portal .skip-link:focus {
  top: 0;
}

/* Reduce motion for users who prefer it
   ISO/IEC 25010 — Accessibility: respect user motion preferences */
@media (prefers-reduced-motion: reduce) {
  .up-portal *,
  .up-portal *::before,
  .up-portal *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}

/* ============================================================
 * 27. PINPOINT LOCATION MAP — Initial setup card
 *     ISO/IEC 25010 — Operability: clear location setup flow.
 *     ISO/IEC 25002 — Effectiveness: guided map interaction.
 * ============================================================ */
.up-portal #pinpointMap {
  height: clamp(280px, 250px + 8vw, 420px);
  border-radius: var(--up-card-radius);
}

.up-portal #editLocationMap {
  height: clamp(220px, 200px + 5vw, 280px);
  border-radius: var(--up-card-radius);
}

/* ============================================================
 * 28. UTILITY CLASSES — Fluid spacing helpers
 *     ISO/IEC 25010 — Maintainability: consistent spacing tokens.
 * ============================================================ */
.up-portal .mb-fluid-sm { margin-bottom: var(--up-gap-sm); }
.up-portal .mb-fluid-md { margin-bottom: var(--up-gap-md); }
.up-portal .mb-fluid-lg { margin-bottom: var(--up-gap-lg); }
.up-portal .mb-fluid-xl { margin-bottom: var(--up-gap-xl); }
.up-portal .mt-fluid-sm { margin-top: var(--up-gap-sm); }
.up-portal .mt-fluid-md { margin-top: var(--up-gap-md); }
.up-portal .mt-fluid-lg { margin-top: var(--up-gap-lg); }
.up-portal .mt-fluid-xl { margin-top: var(--up-gap-xl); }
.up-portal .p-fluid-sm  { padding: var(--up-gap-sm); }
.up-portal .p-fluid-md  { padding: var(--up-gap-md); }
.up-portal .p-fluid-lg  { padding: var(--up-gap-lg); }
.up-portal .gap-fluid-sm { gap: var(--up-gap-sm); }
.up-portal .gap-fluid-md { gap: var(--up-gap-md); }

/* ============================================================
 * 29. HIGH-CONTRAST MODE — Color vision deficiency support
 *     ISO/IEC 25010 — Accessibility: ensure text readability.
 *     ISO/IEC 25002 — Inclusivity: no reliance on color alone.
 * ============================================================ */
@media (forced-colors: active) {
  .up-portal .sw-action-card,
  .up-portal .card,
  .up-portal .fm-card {
    border: 2px solid;
  }

  .up-portal .btn {
    border: 2px solid;
  }
}

/* ============================================================
 * 30. PRINT STYLES — Clean printed output
 *     ISO/IEC 25010 — Portability: content works in print.
 * ============================================================ */
@media print {
  .up-portal .sw-navbar,
  .up-portal .sw-bottom-nav,
  .up-portal .sw-action-grid,
  .up-portal .sw-pheader-actions,
  .up-portal .btn {
    display: none !important;
  }

  .up-portal .card {
    break-inside: avoid;
    box-shadow: none;
    border: 1px solid #ccc;
  }

  .up-portal body {
    background: #fff;
  }
}

/* ============================================================
 * 31. LANDING PAGE ENHANCEMENTS — Fluid hero and sections
 *     ISO/IEC 25010 — Adaptability: landing page scales gracefully.
 *     ISO/IEC 25002 — Satisfaction: strong first impression.
 * ============================================================ */
.sw-landing .sw-hero-title {
  font-size: clamp(2rem, 1.5rem + 2vw, 3.5rem);
  letter-spacing: -0.03em;
}

.sw-landing .sw-hero-subtitle {
  font-size: clamp(0.9375rem, 0.875rem + 0.2vw, 1.125rem);
  max-width: min(640px, 100%);
}

.sw-landing .sw-hero-actions {
  gap: clamp(0.5rem, 0.4rem + 0.3vw, 1rem);
}

.sw-landing .sw-section-title {
  font-size: clamp(1.5rem, 1.25rem + 0.8vw, 2.25rem);
}

.sw-landing .sw-section-subtitle {
  font-size: clamp(0.875rem, 0.85rem + 0.15vw, 1rem);
}

/* ============================================================
 * 32. ENHANCED RESPONSIVE BREAKPOINTS — Fine-tuned across sizes
 *     ISO/IEC 25010 — Adaptability: robust responsive system.
 *     ISO/IEC 25002 — Satisfaction: no layout issues at any width.
 * ============================================================ */

/* Extra small phones (< 360px) */
@media (max-width: 359px) {
  .up-portal .sw-pheader-title {
    font-size: clamp(1.125rem, 1rem + 0.5vw, 1.375rem);
  }

  .up-portal .sw-pheader-actions {
    display: none;
  }

  .up-auth-card {
    border-radius: clamp(0.75rem, 0.5rem + 0.5vw, 1rem);
  }

  .up-auth-header {
    /* 3-value: top | left-right | bottom — keep top generous for logo */
    padding: clamp(1.5rem, 1.2rem + 0.5vw, 2rem) clamp(0.875rem, 0.75rem + 0.4vw, 1.25rem) clamp(0.875rem, 0.75rem + 0.4vw, 1.25rem);
    /* Sync header top-radius with card radius at this breakpoint */
    border-radius: clamp(0.75rem, 0.5rem + 0.5vw, 1rem) clamp(0.75rem, 0.5rem + 0.5vw, 1rem) 0 0;
  }

  .up-auth-header h1 {
    font-size: clamp(1.125rem, 1rem + 0.4vw, 1.375rem);
  }

  .up-auth-card > :last-child {
    border-radius: 0 0 clamp(0.75rem, 0.5rem + 0.5vw, 1rem) clamp(0.75rem, 0.5rem + 0.5vw, 1rem);
  }
}

/* Small phones (360-479px) */
@media (min-width: 360px) and (max-width: 479px) {
  .up-portal .sw-pheader-title {
    font-size: clamp(1.25rem, 1.1rem + 0.5vw, 1.5rem);
  }
}

/* Large phones / small tablets (480-639px) */
@media (min-width: 480px) and (max-width: 639px) {
  .up-portal .sw-pheader-title {
    font-size: clamp(1.375rem, 1.2rem + 0.5vw, 1.625rem);
  }
}

/* Tablets (640-767px) */
@media (min-width: 640px) and (max-width: 767px) {
  .up-portal .sw-action-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Small desktop (768-991px) */
@media (min-width: 768px) and (max-width: 991px) {
  .up-portal .sw-action-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* Large desktop (1200px+) */
@media (min-width: 1200px) {
  .up-portal .container {
    padding-inline: clamp(2rem, 1.5rem + 1vw, 3rem);
  }
}

/* ============================================================
 * 33. SMOOTH SCROLLING & SCROLL BEHAVIOR
 *     ISO/IEC 25010 — Operability: smooth, predictable scrolling.
 *     ISO/IEC 25002 — Satisfaction: polished interaction feel.
 * ============================================================ */
@media (prefers-reduced-motion: no-preference) {
  .up-portal {
    scroll-behavior: smooth;
  }

  .up-portal .fm-panel,
  .up-portal .prof-panel {
    transition: transform 0.3s cubic-bezier(0.32, 0.72, 0, 1);
  }

  .up-portal .fm-overlay,
  .up-portal .bi-overlay {
    transition: opacity 0.25s ease, visibility 0.25s ease;
  }
}

/* ============================================================
 * 34. SAFE AREA INSETS — Notched device support
 *     ISO/IEC 25010 — Adaptability: works with notched phones.
 *     ISO/IEC 25002 — Satisfaction: no content cut off.
 * ============================================================ */
@supports (padding: env(safe-area-inset-bottom)) {
  .up-portal .sw-bottom-nav {
    padding-bottom: env(safe-area-inset-bottom);
  }

  .up-portal .sw-navbar {
    padding-left: env(safe-area-inset-left);
    padding-right: env(safe-area-inset-right);
  }

  .up-auth-body {
    padding-bottom: calc(var(--up-gap-xl) + env(safe-area-inset-bottom));
  }
}

/* ============================================================
 * 35. LANDSCAPE ORIENTATION — Optimized for horizontal view
 *     ISO/IEC 25010 — Adaptability: layout adjusts for landscape.
 *     ISO/IEC 25002 — Efficiency: better space utilization.
 * ============================================================ */
@media (orientation: landscape) and (max-height: 500px) {
  .up-auth-body {
    padding-block: var(--up-gap-md);
    align-items: flex-start;
  }

  .up-auth-header {
    /* Landscape: tighter bottom but keep top generous for logo visibility */
    padding: clamp(1.25rem, 1rem + 0.5vw, 1.75rem) var(--up-gap-md) var(--up-gap-sm);
  }

  .up-auth-logo {
    width: clamp(36px, 32px + 1vw, 46px);
    height: clamp(36px, 32px + 1vw, 46px);
    margin-bottom: var(--up-gap-xs);
  }

  .up-auth-logo svg {
    width: 22px;
    height: 22px;
  }

  .up-portal .sw-pheader {
    padding-block: var(--up-gap-sm);
  }

  .up-portal #map {
    height: clamp(200px, 180px + 10vw, 320px);
  }

  .up-status-page {
    padding-block: var(--up-gap-md);
    align-items: flex-start;
  }
}

/* ============================================================
 * 36. SELECTION STYLING — Branded text selection
 *     ISO/IEC 25010 — Identifiability: consistent brand presence.
 * ============================================================ */
.up-portal ::selection {
  background: var(--primary-100, #dce6fd);
  color: var(--primary-900, #0b2078);
}

.up-auth-layout ::selection {
  background: var(--primary-100, #dce6fd);
  color: var(--primary-900, #0b2078);
}

/* ============================================================
 * 37. CONTENT SKELETON — Loading placeholder for perceived perf
 *     ISO/IEC 25010 — Time Behaviour: perceived performance.
 *     ISO/IEC 25002 — Satisfaction: content feels faster to load.
 * ============================================================ */
.up-skeleton {
  background: linear-gradient(
    90deg,
    var(--neutral-100, #e8eaf3) 25%,
    var(--neutral-50, #f3f4f9) 50%,
    var(--neutral-100, #e8eaf3) 75%
  );
  background-size: 200% 100%;
  border-radius: var(--radius-md, 0.5rem);
  display: block;
}

@media (prefers-reduced-motion: no-preference) {
  .up-skeleton {
    animation: up-skeleton-shimmer 1.5s ease-in-out infinite;
  }
}

@keyframes up-skeleton-shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.up-skeleton--text {
  height: 1em;
  width: 80%;
  margin-bottom: 0.5rem;
}

.up-skeleton--circle {
  border-radius: 50%;
}

/* ============================================================
 * 38. TOAST / SNACKBAR — Feedback notifications
 *     ISO/IEC 25010 — User Error Protection: clear feedback.
 *     ISO/IEC 25002 — Communicability: system status visible.
 * ============================================================ */
.up-toast {
  position: fixed;
  bottom: calc(var(--up-gap-lg) + env(safe-area-inset-bottom, 0px));
  left: 50%;
  transform: translateX(-50%) translateY(120%);
  z-index: 1100;
  background: var(--neutral-800, #1c254a);
  color: #fff;
  padding: var(--up-gap-sm) var(--up-gap-lg);
  border-radius: var(--up-card-radius);
  font-size: var(--up-text-sm);
  font-weight: 500;
  box-shadow: 0 8px 32px rgba(15, 22, 48, 0.25);
  max-width: min(400px, calc(100vw - 2rem));
  text-align: center;
  opacity: 0;
  visibility: hidden;
  transition: transform 0.3s cubic-bezier(0.32, 0.72, 0, 1),
              opacity 0.3s ease,
              visibility 0.3s ease;
}

.up-toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
  visibility: visible;
}

.up-toast--success {
  background: var(--success, #059669);
}

.up-toast--error {
  background: var(--danger, #dc2626);
}

/* ============================================================
 * 39. EMPTY STATES — Friendly empty content placeholders
 *     ISO/IEC 25010 — Appropriateness: guides user when no data.
 *     ISO/IEC 25002 — Learnability: clear path forward.
 * ============================================================ */
.up-empty-state {
  text-align: center;
  padding: var(--up-gap-2xl) var(--up-gap-lg);
  color: var(--neutral-400, #8390ba);
}

.up-empty-state-icon {
  width: clamp(56px, 48px + 2vw, 80px);
  height: clamp(56px, 48px + 2vw, 80px);
  margin: 0 auto var(--up-gap-md);
  opacity: 0.35;
}

.up-empty-state-title {
  font-size: var(--up-text-base);
  font-weight: 700;
  color: var(--neutral-600, #43507c);
  margin-bottom: var(--up-gap-xs);
}

.up-empty-state-desc {
  font-size: var(--up-text-sm);
  max-width: min(360px, 100%);
  margin-inline: auto;
  line-height: 1.6;
}

/* ============================================================
 * 40. COOLDOWN TIMER — Countdown display
 *     ISO/IEC 25010 — Time Behaviour: clear time indication.
 *     ISO/IEC 25002 — Transparency: user knows when to return.
 * ============================================================ */
.up-countdown {
  font-size: var(--up-text-2xl);
  font-weight: 700;
  color: var(--neutral-800, #1c254a);
  font-family: var(--font-mono);
  letter-spacing: 0.05em;
}

.up-countdown--complete {
  color: var(--success, #059669);
}

.up-cooldown-detail {
  background: var(--warning-light, #fffbeb);
  border-radius: var(--up-card-radius);
  border: 1px solid #fde68a;
  padding: var(--up-gap-md);
  margin-bottom: var(--up-gap-lg);
}

.up-cooldown-detail-label {
  font-size: var(--up-text-sm);
  color: #92400e;
  margin-bottom: var(--up-gap-xs);
}

.up-cooldown-detail-value {
  font-size: var(--up-text-xl);
  font-weight: 700;
  color: #92400e;
}

.up-timer-display {
  background: var(--neutral-50, #f3f4f9);
  border-radius: var(--up-card-radius);
  padding: var(--up-gap-md);
  margin-bottom: var(--up-gap-lg);
}

.up-timer-label {
  font-size: var(--up-text-sm);
  color: var(--neutral-600, #43507c);
  margin-bottom: var(--up-gap-xs);
}

/* ============================================================
 * 41. REGISTRATION FORM — Mobile-first wide auth card
 *     ISO/IEC 25010 — Operability: form adapts fluidly to viewport.
 *     ISO/IEC 25002 — Efficiency: multi-column on desktop,
 *     single-column on mobile for optimal input comfort.
 * ============================================================ */

/* Wide auth card override for registration form */
.up-auth-card.sw-auth-card-wide {
  max-width: min(740px, 100%);
}

/* Kill sw-auth-main gradient pseudo-elements when up-auth-body is active
   — the up-auth-layout body already provides the background.
   ISO/IEC 25010 — Identifiability: no conflicting background layers.
   ISO/IEC 25002 — Clarity: clean, single-source background. */
.up-auth-body.sw-auth-main::before,
.up-auth-body.sw-auth-main::after {
  display: none;
}

/* Fix sw-auth-header margin — now inside card, margin causes overlap */
.up-auth-card .sw-auth-header {
  margin-bottom: 0;
}

/* Neutralize sw-auth-form-card card-within-card effect —
   The outer up-auth-card already provides shadow, border, radius.
   sw-auth-form-card's own shadow/border/radius creates a visible
   nested card with a gap (the old gradient bg hid this).
   ISO/IEC 25010 — Operability: seamless visual flow header→form.
   ISO/IEC 25002 — Clarity: no confusing double-card borders. */
.up-auth-card .sw-auth-form-card {
  box-shadow: none;
  border: none;
  border-radius: 0;
  overflow: visible;
  background: transparent;
}

/* Prevent up-auth-form padding from doubling with sw-auth-form-body padding */
.up-auth-card .sw-auth-form-card.up-auth-form {
  padding: 0;
}

/* Fluid padding on the actual form body instead */
.up-auth-card .sw-auth-form-body {
  padding: clamp(1rem, 0.75rem + 0.8vw, 1.75rem);
}

/* Registration auth body: top-align and tighter top padding on all sizes
   since the form is tall and scrollable */
.up-auth-body:has(.sw-auth-card-wide) {
  align-items: flex-start;
  padding-top: clamp(1rem, 0.5rem + 1.5vw, 2rem);
  padding-bottom: clamp(1.5rem, 1rem + 2vw, 3rem);
}

/* Form section fluid enhancements */
.up-auth-card .sw-form-section {
  border-radius: var(--up-card-radius);
  border-color: var(--neutral-100, #e8eaf3);
  margin-bottom: var(--up-gap-md);
}

.up-auth-card .sw-form-section:last-of-type {
  margin-bottom: var(--up-gap-lg);
}

.up-auth-card .sw-form-section-header {
  padding: clamp(0.625rem, 0.5rem + 0.3vw, 0.875rem) clamp(0.875rem, 0.75rem + 0.4vw, 1.25rem);
  gap: var(--up-gap-sm);
}

.up-auth-card .sw-form-section-badge {
  width: clamp(22px, 20px + 0.4vw, 28px);
  height: clamp(22px, 20px + 0.4vw, 28px);
  font-size: var(--up-text-xs);
}

.up-auth-card .sw-form-section-title {
  font-size: var(--up-text-sm);
  font-weight: 700;
}

.up-auth-card .sw-form-section-body {
  padding: clamp(0.875rem, 0.75rem + 0.4vw, 1.25rem);
}

/* Form controls fluid sizing */
.up-auth-card .form-control {
  font-size: var(--up-text-sm);
  padding: clamp(0.5rem, 0.4rem + 0.3vw, 0.625rem) clamp(0.625rem, 0.5rem + 0.3vw, 0.875rem);
  min-height: 44px;
}

.up-auth-card .form-label {
  font-size: var(--up-text-xs);
  font-weight: 600;
  margin-bottom: clamp(0.25rem, 0.2rem + 0.1vw, 0.375rem);
}

.up-auth-card .form-text {
  font-size: clamp(0.6875rem, 0.65rem + 0.1vw, 0.75rem);
}

.up-auth-card .form-group {
  margin-bottom: clamp(0.75rem, 0.6rem + 0.4vw, 1.125rem);
}

.up-auth-card .form-group:last-child {
  margin-bottom: 0;
}

/* Phone/email prefix inputs — fluid */
.up-auth-card .phone-prefix,
.up-auth-card .email-prefix {
  font-size: var(--up-text-xs);
  padding-inline: clamp(0.5rem, 0.4rem + 0.3vw, 0.75rem);
}

/* Password strength bar fluid */
.up-auth-card .pwd-strength {
  margin-top: var(--up-gap-xs);
}

/* ── Fix text/background color contrast ──
   sw-auth-footer in main.css has white text (for dark gradient bg).
   Inside up-auth-card (white bg), text must be dark.
   ISO/IEC 25010 — Accessibility: WCAG 2.2 AA contrast ratio.
   ISO/IEC 25002 — Clarity: text always readable against background. */
.up-auth-card .sw-auth-footer {
  padding: clamp(0.875rem, 0.75rem + 0.4vw, 1.25rem);
  font-size: var(--up-text-sm);
  border-top: 1px solid var(--neutral-100, #e8eaf3);
  text-align: center;
  background: var(--neutral-25, #f9fafd);
  margin-top: 0;
}

.up-auth-card .sw-auth-footer p {
  color: var(--neutral-500, #6371a0);
  margin: 0;
}

.up-auth-card .sw-auth-footer a {
  color: var(--primary-600, #1d46d6);
  font-weight: 600;
  text-decoration-color: var(--primary-200, #b8cbfb);
}

.up-auth-card .sw-auth-footer a:hover {
  color: var(--primary-700, #1638b8);
  text-decoration-color: var(--primary-400, #537df2);
}

/* Privacy box — inside card, ensure visible text contrast */
.up-auth-card .sw-privacy-box {
  font-size: var(--up-text-xs);
  border-radius: clamp(0, 0, 0) var(--up-card-radius) var(--up-card-radius) clamp(0, 0, 0);
  margin: 0;
}

.up-auth-card .sw-privacy-box-title {
  color: var(--primary-800, #102c96);
}

.up-auth-card .sw-privacy-box-text {
  color: var(--neutral-600, #43507c);
}

/* Error alert inside card — visible against white card bg */
.up-auth-card .alert-danger {
  font-size: var(--up-text-sm);
  color: #991b1b;
  background: #fef2f2;
  border-color: #fecaca;
}

/* Submit button fluid */
.up-auth-card .btn-lg {
  font-size: var(--up-text-sm);
  padding: clamp(0.625rem, 0.5rem + 0.3vw, 0.875rem) clamp(1rem, 0.75rem + 0.5vw, 1.5rem);
  min-height: 48px;
  border-radius: clamp(0.5rem, 0.4rem + 0.3vw, 0.75rem);
}

/* T&C agree row fluid */
.up-auth-card .sw-tc-agree {
  padding: clamp(0.625rem, 0.5rem + 0.3vw, 0.875rem);
  border-radius: clamp(0.5rem, 0.4rem + 0.2vw, 0.625rem);
  margin: var(--up-gap-md) 0 var(--up-gap-sm);
  gap: var(--up-gap-sm);
}

.up-auth-card .sw-tc-agree-label {
  font-size: var(--up-text-xs);
  color: var(--neutral-600, #43507c);
}

.up-auth-card .sw-tc-agree-label a {
  color: var(--primary-600, #1d46d6);
}

/* Reg submit hint fluid */
.up-auth-card .reg-submit-hint {
  font-size: var(--up-text-xs);
  margin-top: var(--up-gap-sm);
  color: var(--neutral-500, #6371a0);
}

/* ── Extra small phones (< 360px) ── */
@media (max-width: 359px) {
  .up-auth-card.sw-auth-card-wide {
    border-radius: clamp(0.5rem, 0.3rem + 0.5vw, 0.75rem);
  }

  .up-auth-card.sw-auth-card-wide .up-auth-header {
    /* 3-value: top | left-right | bottom — generous top for logo visibility */
    padding: clamp(1.25rem, 1rem + 0.5vw, 1.75rem) clamp(0.75rem, 0.5rem + 0.5vw, 1rem) clamp(0.75rem, 0.5rem + 0.5vw, 1rem);
    /* Sync header top-radius with card radius */
    border-radius: clamp(0.5rem, 0.3rem + 0.5vw, 0.75rem) clamp(0.5rem, 0.3rem + 0.5vw, 0.75rem) 0 0;
  }

  .up-auth-card.sw-auth-card-wide .up-auth-logo {
    width: clamp(38px, 34px + 1vw, 46px);
    height: clamp(38px, 34px + 1vw, 46px);
    border-radius: clamp(10px, 8px + 0.5vw, 12px);
    margin-bottom: clamp(0.375rem, 0.3rem + 0.2vw, 0.625rem);
  }

  .up-auth-card.sw-auth-card-wide .up-auth-logo svg {
    width: 22px;
    height: 22px;
  }

  .up-auth-card.sw-auth-card-wide .up-auth-header h1 {
    font-size: clamp(1rem, 0.9rem + 0.3vw, 1.25rem);
  }

  .up-auth-card.sw-auth-card-wide .up-auth-header p {
    font-size: clamp(0.6875rem, 0.65rem + 0.1vw, 0.8125rem);
  }

  /* Stack grids to single column */
  .up-auth-card .sw-data-grid-2,
  .up-auth-card .sw-data-grid-3 {
    grid-template-columns: 1fr;
    gap: var(--up-gap-sm);
  }

  .up-auth-card .sw-form-section-body {
    padding: clamp(0.625rem, 0.5rem + 0.3vw, 0.875rem);
  }

  /* Prevent suffix other input + cancel from overflowing */
  .up-auth-card #suffix_other_wrap > div {
    flex-wrap: wrap;
  }

  /* Privacy box — tighter on tiny screens */
  .up-auth-card .sw-privacy-box {
    padding: var(--up-gap-sm) var(--up-gap-md);
  }
}

/* ── Small phones (360-479px) ── */
@media (min-width: 360px) and (max-width: 479px) {
  .up-auth-card .sw-data-grid-2,
  .up-auth-card .sw-data-grid-3 {
    grid-template-columns: 1fr;
    gap: var(--up-gap-sm);
  }

  .up-auth-card.sw-auth-card-wide .up-auth-header h1 {
    font-size: clamp(1.125rem, 1rem + 0.3vw, 1.375rem);
  }
}

/* ── Large phones (480-639px): 2-col grids allowed ── */
@media (min-width: 480px) and (max-width: 639px) {
  .up-auth-card .sw-data-grid-2 {
    grid-template-columns: 1fr 1fr;
  }

  .up-auth-card .sw-data-grid-3 {
    grid-template-columns: 1fr 1fr;
  }
}

/* ── Tablets+ (640px+): full grid columns ── */
@media (min-width: 640px) {
  .up-auth-card .sw-data-grid-2 {
    grid-template-columns: 1fr 1fr;
  }

  .up-auth-card .sw-data-grid-3 {
    grid-template-columns: 1fr 1fr 1fr;
  }

  .up-auth-card .sw-form-section-body {
    padding: clamp(1rem, 0.8rem + 0.5vw, 1.5rem);
  }
}

/* ── Landscape phones: tighter vertical spacing ── */
@media (orientation: landscape) and (max-height: 500px) {
  .up-auth-body:has(.sw-auth-card-wide) {
    padding-block: var(--up-gap-sm);
    align-items: flex-start;
  }

  .up-auth-card .sw-form-section {
    margin-bottom: var(--up-gap-sm);
  }

  .up-auth-card .sw-form-section-body {
    padding: var(--up-gap-sm);
  }

  .up-auth-card .form-group {
    margin-bottom: var(--up-gap-sm);
  }
}

/* Fallback for browsers without :has() — apply via body class */
.up-auth-layout--wide .up-auth-body {
  align-items: flex-start;
  padding-top: clamp(1rem, 0.5rem + 1.5vw, 2rem);
  padding-bottom: clamp(1.5rem, 1rem + 2vw, 3rem);
}
