/* PWA Install Styles */
.pwa-install-container {
  position: fixed;
  bottom: 20px;
  left: 20px;
  z-index: 9999;
}

.pwa-install-btn,
.pwa-manual-btn {
  background: linear-gradient(135deg, #1a1a1a 0%, #333333 100%);
  color: white;
  border: none;
  padding: 12px 20px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  transition: transform 0.2s, box-shadow 0.2s;
}

.pwa-install-btn:hover,
.pwa-manual-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4);
}

.install-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 10000;
}

.install-modal .modal-content {
  background: white;
  padding: 30px;
  border-radius: 12px;
  max-width: 500px;
  width: 90%;
  max-height: 80vh;
  overflow-y: auto;
  position: relative;
}

.install-modal .modal-close {
  position: absolute;
  top: 15px;
  right: 15px;
  font-size: 28px;
  cursor: pointer;
  color: #666;
  line-height: 1;
}

.install-modal .modal-close:hover {
  color: #333;
}

.install-modal h3 {
  margin-bottom: 20px;
  color: #333;
}

.install-modal ol {
  padding-left: 20px;
  line-height: 1.8;
}

.install-modal li {
  margin-bottom: 10px;
}



:root {
  color-scheme: light;
  --bg: #f4f6fb;
  --card: #ffffff;
  --text: #1a1f36;
  --muted: #667085;
  --primary: #6d5df6;
  --primary-dark: #5a4be0;
  --primary-light: #8b7dff;
  --accent: #7c3aed;
  --gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  --gradient-soft: linear-gradient(135deg, rgba(102, 126, 234, 0.12) 0%, rgba(118, 75, 162, 0.12) 100%);
  --border: #e6e9f2;
  --shadow-sm: 0 2px 8px rgba(26, 31, 54, 0.06);
  --shadow-md: 0 12px 32px rgba(26, 31, 54, 0.09);
  --shadow-lg: 0 24px 60px rgba(26, 31, 54, 0.14);
  --radius: 18px;
  --radius-lg: 26px;
  --radius-pill: 999px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-dark); }

/* ---------- Header / Footer ---------- */
.site-header, .site-footer {
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}
.site-footer {
  position: relative;
  border-bottom: none;
  border-top: 1px solid var(--border);
  margin-top: 2.5rem;
}
.nav-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 1rem 0;
  flex-wrap: wrap;
}
.brand {
  color: var(--text);
  text-decoration: none;
  font-weight: 800;
  font-size: 1.15rem;
  letter-spacing: -0.02em;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}
.brand-mark {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: var(--gradient);
  display: inline-grid;
  place-items: center;
  color: #fff;
  font-weight: 800;
  font-size: 0.9rem;
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.35);
}
.top-nav { display: flex; gap: 0.5rem; align-items: center; flex-wrap: wrap; }
.top-nav a, .top-nav .btn-nav { color: var(--muted); text-decoration: none; font-weight: 600; font-size: 0.95rem; }
.top-nav .nav-link { padding: 0.5rem 0.75rem; border-radius: 10px; transition: background 0.2s, color 0.2s; }
.top-nav .nav-link:hover { color: var(--text); background: var(--gradient-soft); }
.top-nav .btn-nav { padding: 0.6rem 1.1rem; border-radius: var(--radius-pill); }
.top-nav .btn-register { background: var(--gradient); color: #fff; box-shadow: 0 4px 14px rgba(102, 126, 234, 0.35); transition: transform 0.2s, box-shadow 0.2s; }
.top-nav .btn-register:hover { transform: translateY(-1px); box-shadow: 0 6px 18px rgba(102, 126, 234, 0.45); }
.top-nav .btn-nav:hover { background: rgba(102, 126, 234, 0.1); }

.top-nav.open { display: flex !important; }

.mobile-nav-toggle {
  display: none;
  width: 42px;
  height: 42px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fff;
  cursor: pointer;
  padding: 0.55rem;
  position: relative;
  box-shadow: var(--shadow-sm);
}
.mobile-nav-toggle span { display: block; width: 100%; height: 3px; background: var(--text); border-radius: 999px; margin-bottom: 6px; transition: transform 0.25s, opacity 0.25s; }
.mobile-nav-toggle span:last-child { margin-bottom: 0; }
.mobile-nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(9px) rotate(45deg); }
.mobile-nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.mobile-nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-9px) rotate(-45deg); }

/* ---------- Flash ---------- */
.flash-stack { display: flex; flex-direction: column; gap: 0.75rem; margin: 1.25rem 0; }
.flash { padding: 0.85rem 1.1rem; border-radius: 14px; border: 1px solid transparent; font-size: 0.95rem; display: flex; align-items: center; gap: 0.5rem; }
.flash-success { background: #ecfdf3; color: #087443; border-color: #a6f4c5; }
.flash-danger { background: #fef3f2; color: #b42318; border-color: #fecdca; }
.flash-warning { background: #fffaeb; color: #b54708; border-color: #fedf89; }
.flash-info { background: #eff8ff; color: #175cd3; border-color: #b2ddff; }

/* ---------- Layout containers ---------- */
.container, .auth-shell, .dashboard-shell {
  width: min(1120px, calc(100% - 2rem));
  margin: 0 auto;
}
.auth-shell {
  min-height: calc(100vh - 120px);
  display: grid;
  place-items: center;
  padding: 2.5rem 0;
}

/* ---------- Hero (home) ---------- */
.hero-section {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 2.5rem;
  align-items: center;
  padding: 2.5rem 0 1.5rem;
}
.hero-section.home-login { padding-top: 2rem; }
.hero-copy h1 {
  font-size: clamp(2.2rem, 4.5vw, 3.3rem);
  margin: 0.5rem 0 1rem;
  line-height: 1.12;
  letter-spacing: -0.03em;
  font-weight: 800;
}
.hero-copy h1 .gradient-text {
  background: var(--gradient);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.hero-text { font-size: 1.1rem; color: var(--muted); max-width: 560px; }
.hero-actions { display: flex; gap: 0.85rem; margin-top: 1.5rem; flex-wrap: wrap; }
.hero-card, .auth-card, .panel-card, .stat-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
}
.hero-card { padding: 1.6rem; }
.hero-login-card { padding: 1.8rem; border-top: 4px solid transparent; border-image: var(--gradient) 1; border-left: none; border-right: none; border-bottom: none; }
.hero-features { display: flex; gap: 1.4rem; margin-top: 2rem; flex-wrap: wrap; }
.hero-feature { display: flex; align-items: center; gap: 0.6rem; color: var(--muted); font-size: 0.95rem; font-weight: 500; }
.hero-feature .hf-icon { width: 30px; height: 30px; border-radius: 9px; background: var(--gradient-soft); display: inline-grid; place-items: center; font-size: 1rem; }

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.18em;
  background: var(--gradient);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  font-weight: 700;
  font-size: 0.75rem;
  display: inline-block;
}

/* ---------- Info / features grid ---------- */
.info-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.25rem; margin: 2rem 0 2.5rem; }
.info-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.6rem;
  box-shadow: var(--shadow-sm);
  transition: transform 0.25s, box-shadow 0.25s;
  position: relative;
  overflow: hidden;
}
.info-card::before { content: ''; position: absolute; inset: 0 0 auto 0; height: 4px; background: var(--gradient); opacity: 0; transition: opacity 0.25s; }
.info-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }
.info-card:hover::before { opacity: 1; }
.info-icon { width: 48px; height: 48px; border-radius: 14px; background: var(--gradient-soft); display: inline-grid; place-items: center; font-size: 1.4rem; margin-bottom: 1rem; }
.info-card h3 { margin: 0 0 0.5rem; font-size: 1.15rem; letter-spacing: -0.01em; }
.info-card p { margin: 0; color: var(--muted); font-size: 0.95rem; }

/* ---------- CTA band ---------- */
.cta-band {
  background: var(--gradient);
  border-radius: var(--radius-lg);
  padding: 2.5rem 2rem;
  color: #fff;
  text-align: center;
  margin: 2rem 0 2.5rem;
  box-shadow: 0 20px 50px rgba(102, 126, 234, 0.35);
  position: relative;
  overflow: hidden;
}
.cta-band::before { content: ''; position: absolute; inset: 0; background: radial-gradient(circle at 20% 20%, rgba(255,255,255,0.15), transparent 45%); }
.cta-band h2 { margin: 0 0 0.5rem; font-size: clamp(1.6rem, 3vw, 2.2rem); position: relative; }
.cta-band p { margin: 0 auto 1.25rem; opacity: 0.92; max-width: 520px; position: relative; }
.cta-band .btn { position: relative; }

/* ---------- Auth card ---------- */
.auth-card {
  width: min(560px, 100%);
  padding: 2.4rem;
  border-top: 4px solid transparent;
  border-image: var(--gradient) 1;
  border-left: none; border-right: none; border-bottom: none;
}
.auth-brand { display: flex; flex-direction: column; align-items: center; text-align: center; margin-bottom: 1.5rem; }
.auth-brand .brand-mark { width: 52px; height: 52px; font-size: 1.3rem; border-radius: 16px; margin-bottom: 0.75rem; }
.auth-header { text-align: center; margin-bottom: 1.6rem; }
.auth-header h1, .hero-card h1, .panel-heading h2 { margin: 0 0 0.5rem; }
.auth-header h1 { font-size: 1.7rem; letter-spacing: -0.02em; }
.auth-header p, .hero-card p, .panel-heading p, .empty-state { color: var(--muted); }
.auth-header p { margin: 0 auto; max-width: 400px; }

.auth-form, .stack-form { display: flex; flex-direction: column; gap: 1.1rem; }
.auth-form .form-group, .stack-form .form-group { margin: 0; }

/* ---------- Forms ---------- */
.form-group { display: flex; flex-direction: column; gap: 0.45rem; text-align: left; }
label { font-weight: 600; font-size: 0.9rem; color: var(--text); }
.optional-text { font-weight: 400; color: var(--muted); font-size: 0.85rem; }
.helper-text { color: var(--muted); font-size: 0.85rem; }
input, select, textarea {
  font: inherit;
  width: 100%;
  padding: 0.85rem 1rem;
  border-radius: 12px;
  border: 1.5px solid var(--border);
  background: #fcfdff;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}
input::placeholder { color: #a0a8bd; }
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--primary);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(109, 93, 246, 0.12);
}
input[type="file"] { padding: 0.65rem 0.75rem; background: #fbfdff; cursor: pointer; }
.phone-group { display: grid; grid-template-columns: 1fr 1.5fr; gap: 0.85rem; }
.country-select { min-width: 160px; }

/* Password visibility toggle */
.input-wrap { position: relative; }
.input-wrap .toggle-password {
  position: absolute;
  right: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1.1rem;
  color: var(--muted);
  padding: 0.25rem;
  line-height: 1;
}
.input-wrap .toggle-password:hover { color: var(--primary); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  border: none;
  border-radius: var(--radius-pill);
  padding: 0.9rem 1.4rem;
  cursor: pointer;
  text-decoration: none;
  font-weight: 700;
  font-size: 0.98rem;
  transition: transform 0.2s, box-shadow 0.2s, background 0.2s;
  gap: 0.5rem;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn.is-submitting { opacity: 0.7; pointer-events: none; }
.btn-primary { background: var(--gradient); color: #fff; box-shadow: 0 6px 18px rgba(102, 126, 234, 0.35); }
.btn-primary:hover { box-shadow: 0 8px 24px rgba(102, 126, 234, 0.45); }
.btn-outline { background: transparent; color: var(--primary); border: 1.5px solid var(--primary); }
.btn-outline:hover { background: var(--gradient-soft); }
.btn-tertiary { background: transparent; color: var(--text); border: 1.5px solid var(--border); }
.btn-tertiary:hover { background: rgba(26, 31, 54, 0.04); }
.btn-block { width: 100%; }

/* ---------- Auth extras ---------- */
.auth-meta { text-align: center; color: var(--muted); font-size: 0.95rem; margin-top: 1.25rem; }
.auth-meta a { font-weight: 600; }
.auth-row { display: flex; justify-content: space-between; align-items: center; font-size: 0.9rem; }
.auth-row label { font-weight: 500; display: inline-flex; align-items: center; gap: 0.4rem; }
.auth-row input[type="checkbox"] { width: auto; }
.forgot-link { color: var(--primary); font-weight: 600; }
.divider { display: flex; align-items: center; gap: 1rem; color: var(--muted); font-size: 0.85rem; margin: 0.25rem 0; }
.divider::before, .divider::after { content: ''; flex: 1; height: 1px; background: var(--border); }

/* Country code picker */
.country-picker { position: relative; min-width: 150px; }
.country-picker-trigger {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.85rem 1rem;
  border-radius: 12px;
  border: 1.5px solid var(--border);
  background: #fcfdff;
  cursor: pointer;
  font: inherit;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.country-picker-trigger:hover { border-color: var(--primary); }
.country-picker-trigger:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 4px rgba(109, 93, 246, 0.12); }
.country-flag { font-size: 1.3rem; line-height: 1; }
.country-dial { font-weight: 700; color: var(--text); }
.country-caret { margin-left: auto; color: var(--muted); font-size: 0.8rem; transition: transform 0.2s; }
.country-picker.open .country-caret { transform: rotate(180deg); }
.country-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  min-width: 260px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: var(--shadow-lg);
  z-index: 200;
  display: none;
  overflow: hidden;
}
.country-picker.open .country-dropdown { display: block; }
.country-search-box { padding: 0.6rem; border-bottom: 1px solid var(--border); }
.country-search-box input { width: 100%; padding: 0.55rem 0.75rem; border-radius: 9px; border: 1.5px solid var(--border); font-size: 0.9rem; }
.country-search-box input:focus { border-color: var(--primary); box-shadow: none; }
.country-list { list-style: none; margin: 0; padding: 0.3rem; max-height: 220px; overflow-y: auto; }
.country-list li {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.55rem 0.6rem;
  border-radius: 9px;
  cursor: pointer;
  font-size: 0.92rem;
  transition: background 0.15s;
}
.country-list li:hover, .country-list li.active { background: var(--gradient-soft); }
.country-list li .cc-name { flex: 1; color: var(--text); font-weight: 500; }
.country-list li .cc-dial { color: var(--muted); font-weight: 600; }
.country-list .cc-empty { color: var(--muted); text-align: center; padding: 0.75rem; cursor: default; }

/* ---------- Shared dashboard primitives kept for compatibility ---------- */
.image-preview {
  width: 96px;
  height: 96px;
  margin-top: 0.4rem;
  border: 1.5px dashed var(--border);
  border-radius: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f8fbff;
  color: var(--muted);
  overflow: hidden;
}
.image-preview img { display: block; width: 96px; height: 96px; object-fit: cover; border-radius: 50%; }
.dashboard-user-card { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.dashboard-avatar {
  width: 84px; height: 84px; border-radius: 50%; object-fit: cover;
  border: 3px solid var(--border); display: grid; place-items: center;
  background: var(--gradient-soft); color: var(--primary); font-weight: 700;
}
.placeholder-avatar { font-size: 1.2rem; }
.form-grid, .panel-grid, .stats-grid { display: grid; gap: 1rem; }
.form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.form-grid .full-width { grid-column: 1 / -1; }
.panel-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.stats-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); margin: 1rem 0 1.5rem; }
.panel-card { padding: 1.4rem; }
.panel-heading { margin-bottom: 1rem; }
.panel-heading h2 { margin-bottom: 0.4rem; font-size: 1.3rem; }
.panel-heading p { margin: 0; }
.list-card { padding: 1.5rem; }
.empty-state { color: var(--muted); padding: 1rem 0; }
.store-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 0.75rem; }
.store-list li { border: 1px solid var(--border); border-radius: 16px; padding: 1rem; display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; background: #f9fbff; }
.store-list strong { display: block; margin-bottom: 0.35rem; }
.store-list p { margin: 0.2rem 0 0; color: var(--muted); }
.store-badge { color: var(--primary); font-weight: 700; background: rgba(109, 93, 246, 0.12); padding: 0.45rem 0.75rem; border-radius: 999px; font-size: 0.85rem; white-space: nowrap; }
.store-actions { display: flex; align-items: center; gap: 0.75rem; flex-wrap: wrap; }

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
  .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hero-section { gap: 2rem; }
}
@media (max-width: 800px) {
  .mobile-nav-toggle { display: inline-flex; }
  .top-nav {
    position: absolute;
    top: calc(100% + 0.5rem);
    right: 1rem;
    left: 1rem;
    flex-direction: column;
    gap: 0.35rem;
    border-radius: 18px;
    background: #fff;
    padding: 1rem;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-lg);
    display: none;
    z-index: 1000;
  }
  .top-nav.open { display: flex; }
  .top-nav a, .top-nav .btn-nav { padding: 0.85rem 1rem; border-radius: 12px; background: #f8fafd; margin: 0.15rem 0; width: 100%; text-align: center; }
  .top-nav .btn-register { background: var(--gradient); color: #fff; }
  .top-nav a { color: var(--text); }
  .form-grid, .panel-grid, .stats-grid, .info-grid, .hero-section { grid-template-columns: 1fr; }
  .hero-section { display: grid; }
  .hero-card, .hero-login-card { margin-top: 1rem; }
  .auth-card, .hero-login-card, .panel-card, .list-card { padding: 1.4rem; }
  .nav-row { padding: 0.9rem 0; }
  .info-grid { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  .top-nav { width: 100%; justify-content: space-between; }
  .hero-copy h1 { font-size: clamp(1.8rem, 7vw, 2.4rem); }
  .hero-actions { flex-direction: column; align-items: stretch; }
  .btn { width: 100%; }
  .stats-grid, .panel-grid, .form-grid { grid-template-columns: 1fr; }
  .phone-group { grid-template-columns: 1fr; }
  .auth-card { padding: 1.5rem; }
}
