/* ================================
   Fonts
=================================== */
@font-face {
  font-family: 'Outfit';
  src: url('../fonts/Outfit-Regular.woff2') format('woff2'),
    url('../fonts/Outfit-Regular.woff') format('woff');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Outfit';
  src: url('../fonts/Outfit-Medium.woff2') format('woff2'),
    url('../fonts/Outfit-Medium.woff') format('woff');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Outfit';
  src: url('../fonts/Outfit-SemiBold.woff2') format('woff2'),
    url('../fonts/Outfit-SemiBold.woff') format('woff');
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Outfit';
  src: url('../fonts/Outfit-Bold.woff2') format('woff2'),
    url('../fonts/Outfit-Bold.woff') format('woff');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

/* ================================
   Reset + interaction polish
=================================== */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body {
  min-width: 0;
}

*:focus,
*:focus-visible {
  outline: none;
}

a,
button,
[role="button"] {
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: 'Outfit', system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  background-color: var(--bg);
  color: var(--text);
}

a {
  color: var(--palette-black);
  text-decoration: underline;
  transition: color 0.2s ease;
}

a:hover,
a:visited {
  color: var(--palette-gray-2);
}

/* ================================
   Variables
=================================== */
:root {
  /* Material Symbols Rounded */
  --msr-size: 20px;
  --msr-color: currentColor;
  --msr-wght: 400;
  --msr-fill: 0;
  --msr-grad: -25;
  --msr-opsz: 20;

  /* Blue-Green Health & Wellness Palette */
  --primary-blue: #2563EB;
  --secondary-green: #10B981;
  --white: #FFFFFF;
  --dark-slate: #1E293B;

  /* Accent Colors */
  --cta-primary: #3B82F6;
  --cta-secondary: #F97316;
  --teal-accent: #06B6D4;
  --success-green: #22C55E;

  /* Modern Grays (Slate) */
  --gray-50: #F8FAFC;
  --gray-100: #F1F5F9;
  --gray-200: #E2E8F0;
  --gray-300: #CBD5E1;
  --gray-600: #475569;
  --gray-900: #0F172A;

  /* Legacy compatibility mappings */
  --palette-black: var(--dark-slate);
  --palette-white: var(--white);
  --palette-gray-1: var(--gray-900);
  --palette-gray-2: var(--gray-600);
  --palette-gray-3: var(--gray-600);
  --palette-gray-4: var(--gray-300);
  --palette-gray-5: var(--gray-200);
  --palette-gray-6: var(--gray-100);
  --palette-gray-7: var(--gray-50);

  /* Semantic Variables (Mapped to New Palette) */
  --bg: var(--white);
  --text: var(--dark-slate);
  --muted: var(--gray-600);
  --border: var(--gray-200);
  --border-strong: var(--gray-600);
  --border-light: var(--gray-100);
  --hint: var(--gray-600);
  --btn: var(--cta-primary);
  --overlay: rgba(15, 23, 42, .45);

  /* Spacing - Apple 8px Grid */
  --space-1: 8px;
  --space-2: 16px;
  --space-3: 24px;
  --space-4: 32px;
  --space-5: 48px;
  --space-6: 64px;
  --space-7: 80px;
  --space-8: 96px;

  /* Transitions - Apple Style */
  --transition-fast: 0.15s ease;
  --transition-smooth: 0.3s cubic-bezier(0.25, 0.1, 0.25, 1);
  --transition-spring: 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);

  /* Legacy Brand Overrides (remapped to new palette) */
  --blue-200: var(--gray-100);
  --blue-300: var(--gray-200);
  --blue-400: var(--gray-300);
  --blue-500: var(--primary-blue);
  /* Primary action mapping */
  --blue-950: var(--dark-slate);
}

/* ================================
   Header
=================================== */
.hawaa-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  /* Changed fixed height to auto/min-height to fit larger logo */
  height: auto;
  min-height: 100px;
  background: var(--palette-white);
  transition: box-shadow .3s ease, border-radius .3s ease;
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
  width: 100%;
}

.hawaa-header.scrolled {
  box-shadow: 0 2px 12px rgba(0, 0, 0, .1);
  border-bottom-left-radius: 24px;
  border-bottom-right-radius: 24px;
}

.header-container {
  /* Adjusted height to fit logo */
  height: auto;
  min-height: 100px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 16px;
  /* Added vertical padding */
}

/* Logo */
.header-logo {
  display: flex;
  align-items: center;
  height: 100%;
}

.header-logo img {
  /* UPDATED LOGO SIZE */
  height: 40px;
  width: auto;
  display: block;
  object-fit: contain;
}

/* Actions */
.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  height: 100%;
}

/* ================================
   Login Button
=================================== */
/* ================================
   Login Button
=================================== */
/* Login Button - TIER 3: Light Blue Tint */
.header-login-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 14px;
  height: 36px;
  border-radius: 18px;
  background: rgba(37, 99, 235, 0.1);
  color: #2563EB;
  font-weight: 500;
  font-size: 14px;
  text-decoration: none;
  transition: background-color 0.2s ease;
}

.header-login-btn:hover {
  background: rgba(37, 99, 235, 0.15);
}

.header-login-btn:active {
  background: rgba(37, 99, 235, 0.2);
}

.header-login-btn:active {
  transform: translateY(0.5px);
}

.header-login-btn .material-symbols-rounded {
  font-size: 20px;
  line-height: 1;
}

/* ================================
   Unified Icon Buttons
=================================== */
.nav-icon,
.hamburger-btn,
.nav-close {
  width: 40px;
  height: 40px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;

  background: none;
  border: none;
  outline: none;
  appearance: none;
  -webkit-appearance: none;

  border-radius: 50%;
  cursor: pointer;
  color: var(--dark-slate);
  transition: background-color .2s ease, color .2s ease, transform .06s ease;
}

.nav-icon:hover,
.hamburger-btn:hover,
.nav-close:hover {
  background-color: rgba(0, 0, 0, 0.04);
}

.nav-icon:active,
.hamburger-btn:active,
.nav-close:active {
  background-color: rgba(0, 0, 0, 0.08);
  transform: scale(0.95);
}

/* Normalize icon size inside buttons */
.nav-icon .material-symbols-rounded,
.hamburger-btn .material-symbols-rounded,
.nav-close .material-symbols-rounded {
  font-size: 24px;
  line-height: 1;
}

/* ================================
   Mobile Nav (overlay + panel)
=================================== */
.mobile-nav {
  position: fixed;
  inset: 0;
  z-index: 1001;
  background: rgba(0, 0, 0, .5);
  visibility: hidden;
  opacity: 0;
  transition: all .3s ease;
}

.mobile-nav.active {
  visibility: visible;
  opacity: 1;
}

.nav-overlay {
  position: absolute;
  inset: 0;
}

.nav-panel {
  position: absolute;
  top: 0;
  right: 0;
  height: 100%;
  width: 100%;
  max-width: 460px;
  background: var(--palette-gray-7);
  transform: translateX(100%);
  transition: transform .3s ease;
  display: flex;
  flex-direction: column;
  border-radius: 24px 0 0 24px;
}

.mobile-nav.active .nav-panel {
  transform: translateX(0);
}

/* Nav header */
.nav-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  background: var(--palette-white);
  border-bottom: 1px solid var(--palette-gray-6);
}

.nav-title {
  font-weight: 600;
  font-size: 28px;
  color: var(--palette-black);
}

.nav-icons {
  display: flex;
  gap: 8px;
}

/* Nav content */
.nav-content {
  flex: 1;
  overflow-y: auto;
  padding: 16px 0;
}

.nav-section {
  margin-bottom: 16px;
  background: var(--palette-white);
  padding: 20px;
  border-radius: 20px;
}

.section-title {
  font-weight: 600;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--palette-gray-3);
  margin-bottom: 12px;
}

.nav-links {
  list-style: none;
}

.nav-links li {
  margin-bottom: 4px;
}

.nav-links a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
  color: var(--palette-black);
  text-decoration: none;
  font-weight: 500;
  font-size: 18px;
  transition: color .2s ease;
}

.nav-links a:hover {
  color: var(--palette-gray-2);
}

.nav-links a .material-symbols-rounded {
  font-size: 20px;
  color: var(--palette-black);
  opacity: .6;
  transition: opacity .2s;
}

.nav-links a:hover .material-symbols-rounded {
  opacity: 1;
}

/* Nav Logout Section */
.nav-logout-section {
  margin-top: auto;
  padding: 20px;
  border-top: 1px solid var(--palette-gray-6);
}

.nav-logout-btn {
  all: unset;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 14px 20px;
  background: var(--palette-white);
  border: 2px solid var(--palette-gray-6);
  border-radius: 16px;
  color: var(--palette-gray-3);
  font-weight: 500;
  font-size: 16px;
  cursor: pointer;
  transition: all 0.2s ease;
  box-sizing: border-box;
}

.nav-logout-btn:hover {
  background: var(--palette-gray-7);
  border-color: var(--palette-gray-5);
  color: var(--palette-gray-2);
}

.nav-logout-btn:active {
  transform: translateY(0.5px);
}

.nav-logout-btn .material-symbols-rounded {
  font-size: 20px;
}

/* State */
body.menu-open {
  overflow: hidden;
}

/* ============================================================
   MATERIAL SYMBOLS ROUNDED — unified system
============================================================ */
.material-symbols-rounded {
  font-family: 'Material Symbols Rounded' !important;
  font-style: normal !important;
  font-weight: normal !important;
  font-size: var(--msr-size) !important;
  line-height: 1 !important;
  display: inline-block !important;
  vertical-align: -0.2em !important;
  color: var(--msr-color) !important;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-variation-settings:
    'FILL' var(--msr-fill),
    'wght' var(--msr-wght),
    'GRAD' var(--msr-grad),
    'opsz' var(--msr-opsz) !important;
}

/* Optional helpers */
.msr-16 {
  --msr-size: 16px;
  --msr-opsz: 20;
}

.msr-20 {
  --msr-size: 20px;
  --msr-opsz: 20;
}

.msr-24 {
  --msr-size: 24px;
  --msr-opsz: 24;
}

.msr-28 {
  --msr-size: 28px;
  --msr-opsz: 24;
}

.msr-32 {
  --msr-size: 32px;
  --msr-opsz: 24;
}

.msr-black {
  --msr-color: var(--palette-black);
}

/* Force black icon */
.msr-gray {
  --msr-color: var(--palette-gray-2);
}

/* Force gray icon */

/* ============================================================
   NEW AUTH DRAWER SYSTEM
============================================================ */

/* Auth Overlay */
.auth-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 2000;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.auth-overlay.active {
  opacity: 1;
  visibility: visible;
}



/* Auth Drawer */
.auth-drawer {
  position: fixed;
  top: 0;
  right: 0;
  width: 100%;
  max-width: 450px;
  height: 100%;
  background: white;
  z-index: 2001;
  transform: translateX(100%);
  transition: transform 0.3s ease;
  display: flex;
  flex-direction: column;
  box-shadow: -2px 0 20px rgba(0, 0, 0, 0.1);
}

.auth-drawer.active {
  transform: translateX(0);
}

/* Auth Header */
.auth-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--palette-gray-6);
  flex-shrink: 0;
}

.auth-header h2 {
  font-size: 20px;
  font-weight: 600;
  margin: 0;
}

.close-btn {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.close-btn:hover {
  background-color: rgba(0, 0, 0, 0.06);
}

.close-btn .material-symbols-rounded {
  font-size: 24px;
}

/* Auth Body */
.auth-body {
  flex: 1;
  padding: 30px 20px;
  overflow-y: auto;
}

/* Auth Screens */
.auth-screen {
  max-width: 350px;
  margin: 0 auto;
}

.auth-screen h3 {
  font-size: 24px;
  font-weight: 600;
  margin-bottom: 8px;
  text-align: center;
  color: var(--palette-black);
}

.auth-screen form {
  margin: 30px 0;
}

/* ================================
   UPDATED INPUT STYLES (FULLY ROUNDED)
=================================== */
.input-group {
  margin-bottom: 20px;
}

.input-group label {
  display: block;
  margin-bottom: 6px;
  font-weight: 500;
  color: var(--palette-black);
  font-size: 14px;
}

.input-group input {
  width: 100%;
  height: 48px;
  padding: 12px 16px;
  border: 2px solid var(--palette-gray-6);
  border-radius: 24px;
  /* Fully rounded */
  font-size: 16px;
  font-family: inherit;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  background: var(--palette-white);
  color: var(--palette-black);
  border-color: var(--palette-gray-5);
}

.input-group input:focus {
  outline: none;
  border-color: var(--palette-black);
  box-shadow: none;
  /* Removed brand shadow */
}

.input-group input::placeholder {
  color: var(--palette-gray-3);
}

/* Phone Input */
.phone-input {
  position: relative;
  display: flex;
  align-items: center;
}

.country-code {
  position: absolute;
  left: 16px;
  z-index: 1;
  font-weight: 600;
  color: var(--palette-gray-2);
  pointer-events: none;
}

.phone-input input {
  padding-left: 55px;
}

/* ================================
   UPDATED BUTTON STYLES (PRIMARY/SECONDARY)
=================================== */

/* Primary Button Structure */
.primary-btn {
  all: unset;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 48px;
  padding: 0 2rem;
  border-radius: 9999px;
  /* Pill shape */
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.02em;
  font-family: inherit;
  position: relative;
  overflow: hidden;

  /* Primary styling */
  background: #3B82F6;
  color: #FFFFFF;
  border: none;
  transition: background-color 0.2s ease, opacity 0.2s ease;
  box-sizing: border-box;
  /* <-- critical: prevents overflow */
}

.primary-btn:hover {
  background: #2563EB;
  opacity: 0.95;
}

.primary-btn:active {
  background: #1D4ED8;
  opacity: 1;
}

/* Mobile navigation */

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

.primary-btn:disabled {
  background: var(--palette-gray-5);
  cursor: not-allowed;
  transform: none;
}

.primary-btn:disabled .button-bg {
  background: var(--palette-gray-5);
}

/* Auth Switch */
.auth-switch {
  text-align: center;
  margin-top: 20px;
  color: var(--palette-gray-3);
  font-size: 14px;
}

.link-btn {
  background: none;
  border: none;
  color: var(--palette-black);
  font-weight: 600;
  cursor: pointer;
  text-decoration: underline;
  font-size: 14px;
  font-family: inherit;
}

.link-btn:hover {
  color: var(--palette-gray-2);
}

.link-btn:hover {
  color: var(--palette-gray-2);
}

.link-btn:disabled {
  color: var(--palette-gray-5);
  cursor: not-allowed;
  text-decoration: none;
}

/* ================================
   OTP SCREEN STYLES (FULLY ROUNDED INPUTS)
=================================== */
.otp-info {
  text-align: center;
  margin-bottom: 30px;
  color: var(--palette-gray-3);
  line-height: 1.5;
  font-size: 14px;
}

.otp-inputs {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin-bottom: 30px;
  width: 100%;
}

.otp-digit {
  width: 50px !important;
  height: 50px !important;
  text-align: center;
  font-size: 20px;
  font-weight: 600;
  border: 2px solid var(--palette-gray-6);
  border-radius: 50% !important;
  /* Fully rounded */
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
  font-family: inherit;
  padding: 0;
}

.otp-digit:focus {
  outline: none;
  border-color: var(--palette-black);
  box-shadow: none;
}

.otp-digit.error {
  border-color: var(--palette-gray-3) !important;
  background-color: var(--palette-gray-7) !important;
}

.otp-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 20px;
  flex-wrap: wrap;
  gap: 12px;
  width: 100%;
}

/* Success Screen */
.success-content {
  text-align: center;
  padding: 40px 0;
}

.success-icon {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: var(--palette-gray-2);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 40px;
  font-weight: bold;
  margin: 0 auto 20px;
}

.success-content h3 {
  color: var(--palette-gray-2);
  margin-bottom: 10px;
}

.success-content p {
  color: var(--palette-gray-3);
  margin-bottom: 30px;
  line-height: 1.5;
}

/* Loading States */
.loading {
  opacity: 0.7;
  pointer-events: none;
}

.loading::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 20px;
  height: 20px;
  margin: -10px 0 0 -10px;
  border: 2px solid var(--palette-black);
  border-top: 2px solid transparent;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }

  100% {
    transform: rotate(360deg);
  }
}

/* Error States */
.error-message {
  color: var(--palette-gray-3);
  font-size: 14px;
  margin-top: 8px;
  text-align: center;
  background: var(--palette-gray-7);
  padding: 8px 12px;
  border-radius: 6px;
  border: 1px solid var(--palette-gray-5);
}

.shake {
  animation: shake 0.4s ease-in-out;
}

@keyframes shake {

  0%,
  100% {
    transform: translateX(0);
  }

  10%,
  30%,
  50%,
  70%,
  90% {
    transform: translateX(-4px);
  }

  20%,
  40%,
  60%,
  80% {
    transform: translateX(4px);
  }
}

/* Form Validation States */
.input-group input.error {
  border-color: var(--palette-gray-3);
  background-color: var(--palette-gray-7);
}

.input-group input.error:focus {
  box-shadow: 0 0 0 3px rgba(255, 68, 68, 0.1);
}

/* Utilities */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

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

/* Responsive Design */
@media (max-width: 768px) {
  .header-logo img {
    height: 32px;
  }

  .auth-drawer {
    max-width: 100%;
  }

  .auth-body {
    padding: 20px 16px;
  }

  .auth-screen form {
    max-width: calc(100vw - 72px);
    /* Account for drawer padding */
  }

  .success-content {
    max-width: calc(100vw - 72px);
  }

  .otp-digit {
    width: 45px !important;
    height: 45px !important;
    font-size: 18px;
  }

  .otp-inputs {
    gap: 8px;
  }

  .auth-screen h3 {
    font-size: 22px;
  }

  .otp-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .otp-actions .link-btn {
    text-align: center;
    padding: 8px;
  }
}

@media (max-width: 480px) {
  .header-container {
    padding: 0 12px;
  }

  .header-login-btn {
    padding: 0 12px;
    height: 32px;
    font-size: 13px;
  }

  .auth-body {
    padding: 20px 12px;
  }

  .auth-screen form {
    max-width: calc(100vw - 64px);
    /* Account for smaller drawer padding */
  }

  .success-content {
    max-width: calc(100vw - 64px);
  }

  .otp-inputs {
    gap: 6px;
  }

  .otp-digit {
    width: 40px !important;
    height: 40px !important;
    font-size: 16px;
  }
}