/* ==========================================================================
   ORDER FOR YOU - APPLE HUMAN MINIMALIST DESIGN SYSTEM (PRODUCTION)
   ========================================================================== */

:root {
  /* Clean Apple Light Palette */
  --bg-main: #f6f8fb;
  --bg-card: #ffffff;
  --bg-secondary: #f1f5f9;
  
  --border-color: #e2e8f0;
  --border-color-strong: #cbd5e1;
  
  --text-main: #0f172a;
  --text-sub: #64748b;
  --text-muted: #94a3b8;
  
  /* Brand Accent Colors (Clean Apple Blue) */
  --accent-blue: #2563eb;
  --accent-blue-hover: #1d4ed8;
  --accent-blue-glow: rgba(37, 99, 235, 0.15);
  
  --accent-green: #10b981;
  --accent-green-hover: #059669;
  
  /* Radii & Shadows */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --radius-full: 9999px;
  
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 16px rgba(15, 23, 42, 0.06);
  --shadow-lg: 0 12px 32px rgba(15, 23, 42, 0.08);

  --transition-fast: all 0.18s ease;
  --transition-normal: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

/* BASE RESETS */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: 'Heebo', 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background-color: var(--bg-main);
  color: var(--text-main);
  direction: rtl;
  min-height: 100vh;
  line-height: 1.5;
  overflow-x: hidden;
  background-image:
    radial-gradient(circle at 10% 0%, rgba(37, 99, 235, 0.08), transparent 30rem),
    radial-gradient(circle at 90% 25%, rgba(16, 185, 129, 0.06), transparent 26rem);
}

/* APP HEADER */
.app-header {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
  padding: 0 clamp(16px, 4vw, 48px);
  background: rgba(255, 255, 255, 0.78);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-color);
}

.header-start,
.header-actions {
  display: flex;
  align-items: center;
  min-width: 0;
}

.header-brand {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 9px;
  direction: ltr;
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
  z-index: 1;
}

.brand-logo-image {
  display: block;
  width: 48px;
  height: 48px;
  object-fit: contain;
  filter: drop-shadow(0 7px 10px rgba(37, 99, 235, 0.18));
}

.logo-text {
  font-size: 1.18rem;
  font-weight: 650;
  color: #334155;
  letter-spacing: -0.45px;
}

.logo-text b {
  color: #10213d;
  font-weight: 900;
}

.menu-lines {
  display: grid;
  gap: 3px;
  width: 17px;
}

.menu-lines i {
  display: block;
  width: 100%;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
}

.hamburger-btn {
  display: inline-flex;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  width: 40px;
  height: 40px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 8px;
  cursor: pointer;
}

.hamburger-btn .bar {
  width: 100%;
  height: 2px;
  background: var(--text-main);
  border-radius: 2px;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.clean-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: var(--radius-md);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-fast);
  border: 1px solid transparent;
  font-family: inherit;
  min-height: 42px;
}

.clean-btn.secondary {
  background: var(--bg-secondary);
  color: var(--text-main);
  border-color: var(--border-color);
}

.clean-btn.primary {
  background: var(--accent-blue);
  color: #ffffff;
}

.clean-btn:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

.clean-btn:active {
  transform: translateY(0);
}

/* VIEWPORT CONTAINER */
.app-viewport {
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: clamp(18px, 3vw, 36px);
}

:focus-visible {
  outline: 3px solid rgba(37, 99, 235, 0.35);
  outline-offset: 2px;
}

button,
input,
select,
textarea {
  font: inherit;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.58;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

.view-section {
  display: none;
}

.view-section.active {
  display: block;
}

/* בזמן שחזור סשן אין להציג אפילו לרגע את מסך הכניסה הסטטי. */
html[data-restoring-session] #landingView {
  display: none !important;
}

html[data-restoring-session] body::before {
  content: "Order for You";
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: grid;
  place-items: center;
  color: #2563eb;
  background: #f6f8fb;
  font: 800 1.15rem/1 "Heebo", sans-serif;
}

html[data-theme="dark"][data-restoring-session] body::before {
  color: #93c5fd;
  background: #08111f;
}

html:not([data-restoring-session]) body::before {
  display: none;
}

/* LANDING SCREEN & MASTER AUTH CARD */
#landingView {
  min-height: calc(100vh - 100px);
  display: flex;
  align-items: center;
  justify-content: center;
}

.landing-hero-compact {
  width: 100%;
  max-width: 440px;
  margin: 0 auto;
  text-align: center;
}

.hero-title-compact {
  font-size: 2.2rem;
  font-weight: 800;
  letter-spacing: -0.8px;
  color: var(--text-main);
  margin-bottom: 6px;
}

.hero-subtitle-compact {
  font-size: 0.95rem;
  color: var(--text-sub);
  margin-bottom: 24px;
  font-weight: 400;
}

.master-auth-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-md);
  text-align: right;
}

/* SEGMENTED CONTROL SWITCHER */
.role-segmented-control {
  position: relative;
  display: flex;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 4px;
  margin-bottom: 20px;
}

.segment-btn {
  flex: 1;
  background: transparent;
  border: none;
  padding: 10px;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-sub);
  cursor: pointer;
  z-index: 2;
  transition: color 0.2s ease;
  font-family: inherit;
  text-align: center;
}

.segment-btn.active {
  color: var(--text-main);
  background: var(--bg-card);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm);
}

/* FORMS */
.auth-forms-group {
  display: none;
}

.auth-forms-group.active {
  display: block;
}

.auth-form {
  display: none;
}

.auth-form.active {
  display: block;
}

.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 6px;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="tel"],
input[type="number"],
select {
  width: 100%;
  background: #ffffff;
  border: 1.5px solid var(--border-color-strong);
  color: var(--text-main);
  padding: 12px 16px;
  min-height: 48px;
  border-radius: var(--radius-md);
  font-size: 16px;
  font-weight: 600;
  font-family: inherit;
  outline: none;
  transition: var(--transition-fast);
  -webkit-tap-highlight-color: transparent;
}

input:focus, select:focus {
  border-color: var(--accent-blue);
  box-shadow: 0 0 0 3px var(--accent-blue-glow);
}

.apple-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--bg-secondary);
  color: var(--text-main);
  border: 1.5px solid var(--border-color);
  padding: 12px 18px;
  min-height: 48px;
  border-radius: var(--radius-md);
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition-fast);
  font-family: inherit;
  -webkit-tap-highlight-color: transparent;
}

.apple-btn:hover { background: #e2e8f0; }
.apple-btn:active { transform: scale(0.97); }

.apple-btn.primary {
  background: var(--accent-blue);
  color: #ffffff;
  border: none;
}

.apple-btn.primary:hover {
  background: var(--accent-blue-hover);
}

.menu-toggle-btn {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color-strong);
  color: var(--text-main);
  font-weight: 700;
  font-size: 0.9rem;
  padding: 8px 14px;
  border-radius: var(--radius-md);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.apple-btn.primary-alt {
  background: var(--text-main);
  color: #ffffff;
  border: none;
}

.apple-btn.success {
  background: var(--accent-green);
  color: #ffffff;
  border: none;
}

.apple-btn.danger {
  background: #dc2626;
  color: #ffffff;
  border: none;
}

.apple-btn.danger:hover {
  background: #b91c1c;
}

.danger-item {
  color: #dc2626 !important;
  font-weight: 700 !important;
}

.menu-divider {
  height: 1px;
  background: var(--border-color);
  margin: 12px 0;
}

.apple-btn.width-full { width: 100%; }

.auth-footer-link {
  text-align: center;
  margin-top: 14px;
  font-size: 0.85rem;
  color: var(--text-sub);
}

.link-action-btn {
  background: transparent;
  border: none;
  color: var(--accent-blue);
  font-weight: 700;
  font-size: 0.85rem;
  cursor: pointer;
  text-decoration: underline;
  font-family: inherit;
}

.otp-notice {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  padding: 10px 14px;
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  color: var(--text-sub);
  margin-bottom: 14px;
  text-align: center;
}

.hidden { display: none !important; }
