/* portal.css — global styles for the customer portal
   Hebrew / RTL / warm burgundy+cream system. */

@import url('https://fonts.googleapis.com/css2?family=Heebo:wght@300;400;500;600;700;800&display=swap');

:root {
  --color-primary:      #8B2E2E;
  --color-primary-dark: #6B1E1E;
  --color-primary-soft: #B04444;
  --color-accent:       #D4A574;
  --color-accent-soft:  #E8C796;

  --color-bg:           #FAF6EF;
  --color-bg-alt:       #FFFFFF;
  --color-bg-warm:      #F5EEE1;
  --color-bg-warm-deep: #EFE5D1;
  --color-text:         #2C1810;
  --color-text-mid:     #5C4838;
  --color-text-light:   #8A7260;
  --color-border:       #E8DECC;
  --color-border-strong:#D4C4A8;

  --color-today:        #E5A83C;
  --color-today-deep:   #C98B1F;
  --color-today-tint:   #FBEBC4;
  --color-done:         #8FA87A;
  --color-done-deep:    #6F8A5A;
  --color-done-tint:    #E6EEDD;
  --color-danger:       #C75B3E;

  --color-wa:           #25D366;
  --color-wa-dark:      #128C7E;

  --r:    12px;
  --r-lg: 20px;
  --r-xl: 28px;

  --sh-xs: 0 1px 2px rgba(44,24,16,0.05);
  --sh-sm: 0 2px 8px rgba(44,24,16,0.08);
  --sh-md: 0 6px 24px rgba(44,24,16,0.10);
  --sh-lg: 0 14px 40px rgba(44,24,16,0.15);
  --glow-today: 0 0 0 1px rgba(229,168,60,0.2), 0 8px 28px rgba(229,168,60,0.18);
}

html, body { margin: 0; padding: 0; height: 100%; }
body { background: var(--color-bg-warm-deep); }

.portal {
  font-family: 'Heebo', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  color: var(--color-text);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  direction: rtl;
  text-align: right;
  font-size: 15px;
  background: var(--color-bg);
}

.portal * { box-sizing: border-box; }
.portal h1, .portal h2, .portal h3, .portal h4, .portal h5 {
  margin: 0; line-height: 1.25; color: var(--color-text);
}
.portal p { margin: 0; }
.portal button {
  font-family: inherit; cursor: pointer; border: none; background: none;
  padding: 0; color: inherit;
}
.portal ::-webkit-scrollbar { width: 0; height: 0; }
.portal .tabular { font-variant-numeric: tabular-nums; }

/* Phone root — full viewport, stretches vertically to fill the window */
.portal-root {
  position: relative;
  max-width: 460px;
  margin: 0 auto;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--color-bg);
  box-shadow: var(--sh-md);
  overflow: hidden;
}

.portal-eyebrow {
  font-size: 0.72rem; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.08em; color: var(--color-primary);
}
.portal-meta { font-size: 0.82rem; color: var(--color-text-light); }

.portal-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 11px; border-radius: 999px;
  font-size: 0.78rem; font-weight: 500;
  background: var(--color-bg-warm); color: var(--color-text-mid);
}
.portal-chip.chip-today {
  background: var(--color-today-tint);
  color: var(--color-today-deep); font-weight: 600;
}
.portal-chip.chip-done {
  background: var(--color-done-tint); color: var(--color-done-deep);
}
.portal-chip.chip-primary {
  background: var(--color-primary); color: #fff;
}
.portal-chip.chip-outline {
  background: transparent; border: 1px solid var(--color-border);
  color: var(--color-text-mid);
}

.portal-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 18px; border-radius: var(--r);
  font-size: 0.92rem; font-weight: 600;
  background: var(--color-primary); color: #fff;
  transition: background .15s;
}
.portal-btn.ghost    { background: transparent; color: var(--color-primary); }
.portal-btn.outline  { background: var(--color-bg-alt); color: var(--color-text); border: 1px solid var(--color-border); }
.portal-btn.wa       { background: var(--color-wa); }

@keyframes portal-pulse-gold {
  0%,100% { box-shadow: var(--glow-today); }
  50%     { box-shadow: 0 0 0 1px rgba(229,168,60,.3), 0 10px 32px rgba(229,168,60,.28); }
}
@keyframes portal-bounce {
  0%,100% { transform: translateY(0); }
  50%     { transform: translateY(-2px); }
}
@keyframes portal-fade-in {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: none; }
}
@keyframes portal-dots {
  0%,60%,100% { opacity: .3; }
  30%         { opacity: 1; }
}
@keyframes portal-sheet-up {
  from { transform: translateY(100%); }
  to   { transform: translateY(0); }
}

.portal-scroll-x {
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
}
.portal-scroll-x > * { scroll-snap-align: start; }

/* Full-viewport error state */
.portal-error {
  font-family: 'Heebo', sans-serif;
  direction: rtl;
  max-width: 460px; margin: 0 auto; padding: 60px 24px;
  text-align: center; color: var(--color-text);
}
.portal-error h1 {
  font-size: 22px; font-weight: 800; color: var(--color-primary);
  margin-bottom: 10px;
}
.portal-error p { color: var(--color-text-mid); line-height: 1.55; }

/* Token-entry screen — shown in the native app on cold launch with no stored
   token, or after the stored token returns 404. Web app never hits this. */
.token-entry {
  font-family: 'Heebo', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  direction: rtl; text-align: center;
  max-width: 440px; margin: 0 auto;
  padding: 80px 24px 40px;
  min-height: 100vh; min-height: 100dvh;
  background: var(--color-bg);
  color: var(--color-text);
  display: flex; flex-direction: column; gap: 14px;
}
.token-entry-logo {
  font-size: 28px; font-weight: 800; color: var(--color-primary);
  letter-spacing: -0.01em; margin-bottom: 8px;
}
.token-entry-hint {
  font-size: 15px; color: var(--color-text-mid); line-height: 1.5;
  margin-bottom: 4px;
}
.token-entry-input {
  width: 100%; padding: 14px 16px;
  border: 1.5px solid var(--color-border-strong);
  border-radius: var(--r);
  font-size: 16px; /* ≥16px avoids iOS auto-zoom on focus */
  font-family: inherit;
  background: var(--color-bg-alt);
  color: var(--color-text);
  direction: ltr; text-align: center;
}
.token-entry-input:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(139,46,46,0.15);
}
.token-entry-submit {
  width: 100%; padding: 14px 16px;
  border: none; border-radius: var(--r);
  background: var(--color-primary); color: #fff;
  font-size: 16px; font-weight: 700; font-family: inherit;
  cursor: pointer;
}
.token-entry-submit:disabled { opacity: 0.55; cursor: wait; }
.token-entry-submit:active { background: var(--color-primary-dark); }
.token-entry-error {
  min-height: 20px;
  font-size: 13.5px; color: var(--color-danger);
  margin-top: 2px;
}
