/* =====================================================
   Dawa Finder - Shared Design Tokens & Base Styles
   ===================================================== */

:root {
  /* Color palette */
  --color-primary: #0F5C57;       /* deep teal - brand, headers, primary actions */
  --color-primary-light: #157A73;
  --color-primary-dark: #0A4541;
  --color-accent: #E8553D;        /* coral - CTAs, urgency, "search now" */
  --color-accent-dark: #C8432D;
  --color-bg: #FAF6EE;            /* warm cream background */
  --color-surface: #FFFFFF;
  --color-sage: #D4E8E2;          /* soft sage - cards, badges */
  --color-text: #222B2A;          /* charcoal */
  --color-text-muted: #6B7674;
  --color-border: #E5E0D5;
  --color-amber: #F2A93B;         /* closing soon / warnings */
  --color-amber-bg: #FDF3E0;
  --color-red: #D64545;           /* urgency high / errors */
  --color-red-bg: #FBE9E9;
  --color-green: #2E8B57;         /* available / success */
  --color-green-bg: #E6F4EC;

  /* Typography */
  --font-display: 'Tajawal', 'Inter', sans-serif;
  --font-body: 'Inter', 'Tajawal', sans-serif;

  /* Spacing scale */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --space-7: 48px;

  /* Radius */
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-pill: 999px;

  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(15, 92, 87, 0.08);
  --shadow-md: 0 4px 16px rgba(15, 92, 87, 0.10);
  --shadow-lg: 0 8px 32px rgba(15, 92, 87, 0.14);

  /* Layout */
  --max-width: 480px;
}

* {
  box-sizing: border-box;
}

/* Keep elements with the HTML hidden attribute truly hidden, even when component
   classes such as .modal-overlay define their own display value. */
[hidden] {
  display: none !important;
}


html, body {
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-body);
  background: var(--color-bg);
  color: var(--color-text);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 700;
  margin: 0;
  color: var(--color-primary-dark);
}

p {
  margin: 0;
}

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

img {
  max-width: 100%;
  display: block;
}

button {
  font-family: inherit;
  cursor: pointer;
}

input, select, textarea, button {
  font-family: inherit;
  font-size: inherit;
}

/* ---------------------------------------------------
   Buttons
   --------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: 14px 24px;
  border-radius: var(--radius-md);
  border: none;
  font-weight: 700;
  font-size: 15px;
  font-family: var(--font-display);
  transition: transform 0.12s ease, box-shadow 0.12s ease, background-color 0.15s ease;
  text-decoration: none;
  white-space: nowrap;
}

.btn:active {
  transform: scale(0.97);
}

.btn-primary {
  background: var(--color-accent);
  color: #fff;
  box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
  background: var(--color-accent-dark);
}

.btn-primary:disabled {
  background: #D8CFC2;
  color: #9A9286;
  cursor: not-allowed;
}

.btn-secondary {
  background: var(--color-sage);
  color: var(--color-primary-dark);
}

.btn-secondary:hover {
  background: #C2DDD5;
}

.btn-outline {
  background: transparent;
  border: 1.5px solid var(--color-border);
  color: var(--color-text);
}

.btn-outline:hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
}

.btn-block {
  width: 100%;
}

.btn-sm {
  padding: 8px 14px;
  font-size: 13px;
  border-radius: var(--radius-sm);
}

.btn-call {
  background: var(--color-primary);
  color: #fff;
}
.btn-call:hover { background: var(--color-primary-light); }

.btn-whatsapp {
  background: #25D366;
  color: #fff;
}
.btn-whatsapp:hover { background: #1FB855; }

/* ---------------------------------------------------
   Form elements
   --------------------------------------------------- */
.field {
  margin-bottom: var(--space-4);
}

.field label {
  display: block;
  font-weight: 600;
  font-size: 14px;
  margin-bottom: var(--space-2);
  color: var(--color-text);
}

.field input,
.field select,
.field textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-surface);
  color: var(--color-text);
  outline: none;
  transition: border-color 0.15s ease;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: var(--color-primary);
}

.field-hint {
  font-size: 12px;
  color: var(--color-text-muted);
  margin-top: var(--space-1);
}

.field-error {
  font-size: 12px;
  color: var(--color-red);
  margin-top: var(--space-1);
}

/* ---------------------------------------------------
   Cards & badges
   --------------------------------------------------- */
.card {
  background: var(--color-surface);
  border-radius: var(--radius-md);
  padding: var(--space-4);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--color-border);
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  font-size: 12px;
  font-weight: 700;
}

.badge-green {
  background: var(--color-green-bg);
  color: var(--color-green);
}

.badge-amber {
  background: var(--color-amber-bg);
  color: #B5790F;
}

.badge-red {
  background: var(--color-red-bg);
  color: var(--color-red);
}

.badge-sage {
  background: var(--color-sage);
  color: var(--color-primary-dark);
}

/* ---------------------------------------------------
   Layout helpers
   --------------------------------------------------- */
.app-container {
  max-width: var(--max-width);
  margin: 0 auto;
  min-height: 100vh;
  background: var(--color-bg);
  display: flex;
  flex-direction: column;
}

.app-header {
  padding: var(--space-5) var(--space-4) var(--space-4);
  background: var(--color-primary);
  color: #fff;
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

.app-header h1 {
  color: #fff;
  font-size: 22px;
}

.app-header .subtitle {
  color: rgba(255,255,255,0.8);
  font-size: 14px;
  margin-top: var(--space-1);
}

.app-content {
  flex: 1;
  padding: var(--space-4);
  padding-bottom: var(--space-7);
}

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

.text-muted {
  color: var(--color-text-muted);
  font-size: 14px;
}

.text-center {
  text-align: center;
}

.flex {
  display: flex;
}

.flex-between {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-2);
}

.flex-gap {
  display: flex;
  gap: var(--space-2);
}

.mt-1 { margin-top: var(--space-1); }
.mt-2 { margin-top: var(--space-2); }
.mt-3 { margin-top: var(--space-3); }
.mt-4 { margin-top: var(--space-4); }
.mt-5 { margin-top: var(--space-5); }
.mb-1 { margin-bottom: var(--space-1); }
.mb-2 { margin-bottom: var(--space-2); }
.mb-3 { margin-bottom: var(--space-3); }
.mb-4 { margin-bottom: var(--space-4); }

/* ---------------------------------------------------
   Toast / alert messages
   --------------------------------------------------- */
.alert {
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-sm);
  font-size: 14px;
  margin-bottom: var(--space-4);
}

.alert-error {
  background: var(--color-red-bg);
  color: var(--color-red);
  border: 1px solid #F4C7C7;
}

.alert-success {
  background: var(--color-green-bg);
  color: var(--color-green);
  border: 1px solid #BFE3CC;
}

.alert-info {
  background: var(--color-sage);
  color: var(--color-primary-dark);
}

.alert-warning {
  background: var(--color-amber-bg);
  color: #8A5A0F;
  border: 1px solid #F1D49B;
}

/* ---------------------------------------------------
   Loading spinner
   --------------------------------------------------- */
.spinner {
  width: 20px;
  height: 20px;
  border: 2.5px solid rgba(255,255,255,0.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

.spinner-dark {
  border: 2.5px solid var(--color-border);
  border-top-color: var(--color-primary);
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ---------------------------------------------------
   Skeleton loading
   --------------------------------------------------- */
.skeleton {
  background: linear-gradient(90deg, var(--color-border) 25%, #F0EBE0 50%, var(--color-border) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-sm);
}

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

/* ---------------------------------------------------
   Utility - visually hidden
   --------------------------------------------------- */
.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;
}

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

/* =====================================================
   Production Polish Pass - Modern Healthcare Interface
   ===================================================== */
:root {
  --color-primary: #08635d;
  --color-primary-light: #119184;
  --color-primary-dark: #043f3b;
  --color-accent: #ff6b4a;
  --color-accent-dark: #e45234;
  --color-bg: #f5f8f6;
  --color-surface: #ffffff;
  --color-sage: #dff3ee;
  --color-text: #182421;
  --color-text-muted: #687a75;
  --color-border: #e2ebe7;
  --radius-sm: 10px;
  --radius-md: 18px;
  --radius-lg: 28px;
  --shadow-sm: 0 8px 22px rgba(6, 71, 67, 0.06);
  --shadow-md: 0 18px 44px rgba(6, 71, 67, 0.10);
  --shadow-lg: 0 24px 70px rgba(6, 71, 67, 0.15);
}

html { scroll-behavior: smooth; }

body {
  background:
    radial-gradient(circle at top left, rgba(17,145,132,0.14), transparent 34rem),
    radial-gradient(circle at 92% 8%, rgba(255,107,74,0.10), transparent 30rem),
    linear-gradient(180deg, #f8fbfa 0%, #f2f6f4 100%);
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image: linear-gradient(rgba(8,99,93,0.035) 1px, transparent 1px), linear-gradient(90deg, rgba(8,99,93,0.035) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: linear-gradient(to bottom, rgba(0,0,0,0.55), transparent 55%);
  z-index: -1;
}

::selection { background: rgba(255,107,74,0.22); }

h1, h2, h3, h4 { letter-spacing: -0.02em; }

button, .btn, a, input, select, textarea { -webkit-tap-highlight-color: transparent; }

:focus-visible {
  outline: 3px solid rgba(255,107,74,0.35);
  outline-offset: 3px;
}

.btn {
  min-height: 46px;
  letter-spacing: -0.01em;
  box-shadow: none;
}

.btn-primary {
  background: linear-gradient(135deg, var(--color-accent), #ff896d);
  box-shadow: 0 12px 24px rgba(255,107,74,0.22);
}

.btn-primary:hover { box-shadow: 0 16px 32px rgba(255,107,74,0.28); }

.btn-secondary {
  background: linear-gradient(135deg, #e6f6f2, #d8eee8);
  border: 1px solid rgba(8,99,93,0.08);
}

.btn-outline {
  background: rgba(255,255,255,0.72);
  border-color: rgba(8,99,93,0.14);
}

.btn-outline:hover {
  background: #fff;
  box-shadow: var(--shadow-sm);
}

.field label {
  color: #203631;
  letter-spacing: -0.01em;
}

.field input,
.field select,
.field textarea,
.medicine-name-input,
.quantity-input {
  min-height: 46px;
  border-color: rgba(8,99,93,0.16);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.75);
}

.field input:focus,
.field select:focus,
.field textarea:focus,
.medicine-name-input:focus,
.quantity-input:focus {
  border-color: var(--color-primary-light);
  box-shadow: 0 0 0 4px rgba(17,145,132,0.10);
}

.card {
  border: 1px solid rgba(8,99,93,0.10);
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(8px);
}

.card:hover,
.result-card:hover,
.queue-card:hover,
.branch-list-item:hover,
.admin-list-item:hover,
.reach-later-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.card,
.result-card,
.queue-card,
.branch-list-item,
.admin-list-item,
.reach-later-card,
.stat-card,
.announcement-card,
.branch-form-block {
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease, background-color 0.18s ease;
}

.badge {
  min-height: 24px;
  letter-spacing: -0.01em;
}

.badge-green { background: #e8f8ef; color: #19764a; }
.badge-amber { background: #fff4df; color: #a96b08; }
.badge-red { background: #ffeceb; color: #c73d35; }
.badge-sage { background: #e4f4ef; color: var(--color-primary-dark); }

.app-container {
  max-width: 520px;
  background: rgba(255,255,255,0.55);
  box-shadow: 0 0 0 1px rgba(8,99,93,0.05), var(--shadow-lg);
}

.app-header {
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, var(--color-primary-dark), var(--color-primary) 58%, var(--color-primary-light));
  box-shadow: 0 18px 45px rgba(8,99,93,0.22);
}

.app-header::after {
  content: '';
  position: absolute;
  width: 190px;
  height: 190px;
  border-radius: 50%;
  background: rgba(255,255,255,0.10);
  right: -72px;
  top: -88px;
}

.app-header > * { position: relative; z-index: 1; }

.app-content { padding-top: var(--space-5); }

.brand-logo,
.brand-icon,
.admin-sidebar .brand-icon,
.auth-logo .brand-icon {
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.28), 0 12px 28px rgba(0,0,0,0.12);
}

.section-title {
  font-size: 19px;
  color: var(--color-primary-dark);
}

.alert {
  box-shadow: var(--shadow-sm);
  font-weight: 600;
}

.hero-card {
  background: linear-gradient(145deg, rgba(255,255,255,0.96), rgba(239,249,246,0.92));
  border: 1px solid rgba(8,99,93,0.12);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  margin-bottom: var(--space-4);
  box-shadow: var(--shadow-md);
  position: relative;
  overflow: hidden;
}

.hero-card::after {
  content: '';
  position: absolute;
  width: 160px;
  height: 160px;
  border-radius: 50%;
  right: -70px;
  bottom: -88px;
  background: radial-gradient(circle, rgba(255,107,74,0.16), transparent 70%);
}

.hero-card h2 {
  font-size: 24px;
  line-height: 1.12;
  margin: 6px 0 8px;
}

.hero-card p {
  color: var(--color-text-muted);
  max-width: 36rem;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--color-primary);
  background: rgba(8,99,93,0.08);
  border: 1px solid rgba(8,99,93,0.08);
  border-radius: var(--radius-pill);
  padding: 5px 11px;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .06em;
}

.mini-step-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: var(--space-4);
}

.mini-step-grid span {
  background: rgba(255,255,255,0.82);
  border: 1px solid rgba(8,99,93,0.10);
  border-radius: 14px;
  padding: 10px 8px;
  text-align: center;
  color: var(--color-primary-dark);
  font-size: 12px;
  font-weight: 800;
}

.auth-container {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.auth-logo { margin-bottom: var(--space-4); }
.auth-logo h1 { font-size: 30px; }
.auth-helper-card { padding: var(--space-4); }
.auth-helper-card.compact h2 { font-size: 20px; }
.auth-helper-card.compact p { font-size: 14px; }

.empty-state {
  background: rgba(255,255,255,0.56);
  border: 1px dashed rgba(8,99,93,0.16);
  border-radius: var(--radius-lg);
}

.skeleton { border-radius: var(--radius-md); }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: rgba(8,99,93,0.20); border-radius: var(--radius-pill); }
::-webkit-scrollbar-track { background: transparent; }

@media (min-width: 768px) {
  .page-customer .app-container,
  .page-pharmacy:not(.page-pharmacy-register) .app-container {
    margin-block: 24px;
    border-radius: var(--radius-lg);
    min-height: calc(100vh - 48px);
    overflow: hidden;
  }
  .page-pharmacy-register .auth-container {
    max-width: 760px;
  }
}

@media (max-width: 460px) {
  .mini-step-grid { grid-template-columns: 1fr; }
  .hero-card h2 { font-size: 21px; }
  .app-container { box-shadow: none; }
}


/* ---------------------------------------------------
   Weekday / hour request heatmap
   --------------------------------------------------- */
.time-heatmap {
  display: grid;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.time-heatmap-header,
.time-heatmap-row {
  display: grid;
  grid-template-columns: 72px repeat(24, minmax(24px, 1fr));
  gap: 4px;
  align-items: center;
  min-width: 760px;
}

.time-heatmap-header {
  color: var(--color-text-muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .04em;
}

.time-heatmap-day {
  color: var(--color-primary-dark);
  font-size: 12px;
  font-weight: 800;
}

.time-heat-cell {
  min-height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: rgba(8, 99, 93, calc(0.06 + (var(--heat, 0) * 0.34)));
  color: var(--color-primary-dark);
  font-size: 11px;
  font-weight: 800;
  border: 1px solid rgba(8, 99, 93, 0.08);
}

/* ---------------------------------------------------
   PWA install prompt
   --------------------------------------------------- */
.pwa-install-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 18px;
  background: rgba(11, 33, 31, 0.28);
  backdrop-filter: blur(4px);
}

.pwa-install-card {
  position: relative;
  width: min(100%, 430px);
  border-radius: 24px;
  padding: 18px;
  background: var(--color-surface);
  box-shadow: 0 24px 80px rgba(8, 35, 32, 0.24);
  border: 1px solid rgba(8, 99, 93, 0.12);
  display: grid;
  grid-template-columns: 54px 1fr;
  gap: 14px;
  animation: pwaSlideUp .22s ease-out;
}

.pwa-install-close {
  position: absolute;
  top: 10px;
  right: 12px;
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 50%;
  background: rgba(8, 99, 93, 0.08);
  color: var(--color-primary-dark);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}

.pwa-install-icon {
  width: 54px;
  height: 54px;
  border-radius: 18px;
  background: linear-gradient(135deg, var(--color-primary), var(--color-primary-light));
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 30px;
  font-weight: 900;
}

.pwa-install-copy h3 {
  margin: 0 34px 5px 0;
  color: var(--color-primary-dark);
  font-size: 18px;
}

.pwa-install-copy p {
  margin: 0;
  color: var(--color-text-muted);
  font-size: 13px;
  line-height: 1.5;
}

.pwa-ios-help {
  margin-top: 8px !important;
  color: var(--color-primary-dark) !important;
  font-weight: 700;
}

.pwa-install-actions {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
}

@keyframes pwaSlideUp {
  from { transform: translateY(20px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

@media (min-width: 700px) {
  .pwa-install-overlay { align-items: center; }
}

.pwa-ios-guide-card {
  position: relative;
  width: min(100%, 460px);
  max-height: min(92vh, 780px);
  overflow: auto;
  border-radius: 26px;
  padding: 20px;
  background: var(--color-surface);
  box-shadow: 0 24px 80px rgba(8, 35, 32, 0.24);
  border: 1px solid rgba(8, 99, 93, 0.12);
  animation: pwaSlideUp .22s ease-out;
}

.pwa-ios-guide-card h3 {
  margin: 0 34px 8px 0;
  color: var(--color-primary-dark);
  font-size: 19px;
}

.pwa-ios-guide-card p {
  margin: 0 0 14px;
  color: var(--color-text-muted);
  font-size: 14px;
  line-height: 1.55;
}

.pwa-ios-guide-img {
  display: block;
  width: 100%;
  max-height: 58vh;
  object-fit: contain;
  border-radius: 20px;
  border: 1px solid rgba(8, 99, 93, 0.10);
  background: #F6FBF8;
}

.pwa-install-actions.single {
  grid-template-columns: 1fr;
  margin-top: 14px;
}

/* Bilingual language switcher */
.df-language-switcher {
  position: static;
  z-index: 3;
  display: inline-flex;
  flex-shrink: 0;
  gap: 3px;
  padding: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(8, 99, 93, 0.14);
  box-shadow: 0 10px 30px rgba(8, 35, 32, 0.10);
  backdrop-filter: blur(10px);
}

.app-header .df-language-switcher {
  background: rgba(255,255,255,0.18);
  border-color: rgba(255,255,255,0.24);
  box-shadow: none;
}

.app-header .df-language-switcher button {
  color: #fff;
}

.app-header .df-language-switcher button.active {
  background: #fff;
  color: var(--color-primary);
}

.df-language-switcher.floating-fallback {
  position: fixed;
  top: max(12px, env(safe-area-inset-top));
  right: 12px;
  z-index: 9998;
}

.auth-language-row {
  display: flex;
  justify-content: flex-end;
  margin-bottom: var(--space-3);
}

.brand-row .df-language-switcher {
  margin-left: auto;
}

html[dir="rtl"] .brand-row .df-language-switcher {
  margin-left: 0;
  margin-right: auto;
}

.results-header .df-language-switcher,
.queue-header-actions .df-language-switcher,
.branch-select-hero-row .df-language-switcher {
  margin-inline: 8px;
}

.df-language-switcher button {
  border: 0;
  border-radius: 999px;
  padding: 6px 10px;
  background: transparent;
  color: var(--color-primary-dark);
  font-weight: 800;
  font-size: 12px;
  line-height: 1;
  cursor: pointer;
}

.df-language-switcher button.active {
  background: var(--color-primary);
  color: #fff;
}

html[dir="rtl"] body {
  font-family: 'Tajawal', 'Inter', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  text-align: right;
}

html[dir="rtl"] .df-language-switcher.floating-fallback {
  right: auto;
  left: 12px;
}

html[dir="rtl"] input,
html[dir="rtl"] textarea,
html[dir="rtl"] select {
  text-align: right;
}

html[dir="rtl"] input[type="tel"],
html[dir="rtl"] input[type="email"],
html[dir="rtl"] input[type="password"],
html[dir="rtl"] input[type="number"],
html[dir="rtl"] input[type="time"] {
  direction: ltr;
  text-align: left;
}

html[dir="rtl"] .flex-between,
html[dir="rtl"] .flex-gap,
html[dir="rtl"] .brand-row,
html[dir="rtl"] .result-card-header,
html[dir="rtl"] .queue-card-header,
html[dir="rtl"] .branch-list-item-header,
html[dir="rtl"] .reach-later-card-header,
html[dir="rtl"] .result-card-actions,
html[dir="rtl"] .reach-later-actions,
html[dir="rtl"] .branch-list-actions,
html[dir="rtl"] .profile-logo-row,
html[dir="rtl"] .queue-header-actions {
  direction: rtl;
}

html[dir="rtl"] .back-link svg,
html[dir="rtl"] .queue-header-actions svg {
  transform: scaleX(-1);
}

html[dir="rtl"] .pwa-install-copy h3,
html[dir="rtl"] .pwa-ios-guide-card h3 {
  margin: 0 0 8px 34px;
}

html[dir="rtl"] .pwa-install-close {
  right: auto;
  left: 12px;
}

html[dir="rtl"] .map-pin-label,
html[dir="rtl"] .leaflet-container,
html[dir="rtl"] .time-heat-cell {
  direction: ltr;
}


/* Remember-me login row */
.remember-login-row {
  margin-top: var(--space-2);
  align-items: center;
  color: var(--color-text-muted);
  font-size: 14px;
  font-weight: 700;
}

.remember-login-row input {
  width: 18px;
  height: 18px;
  accent-color: var(--color-primary);
}

@media (max-width: 420px) {
  .app-header .df-language-switcher button {
    padding: 6px 8px;
    font-size: 11px;
  }
  .results-header .flex-between,
  .branch-select-hero-row {
    gap: 6px;
  }
  .results-header .df-language-switcher,
  .queue-header-actions .df-language-switcher,
  .branch-select-hero-row .df-language-switcher {
    margin-inline: 3px;
  }
}


/* Dawa Finder logo wordmark integration */
.brand-wordmark {
  display: block;
  width: auto;
  max-width: 100%;
  object-fit: contain;
}
.brand-wordmark-card {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,0.96);
  border: 1px solid rgba(255,255,255,0.5);
  border-radius: 18px;
  padding: 8px 12px;
  box-shadow: 0 14px 32px rgba(0,0,0,0.12);
}
.brand-wordmark-header {
  height: 52px;
  max-width: min(300px, 70vw);
}
.auth-logo-wordmark {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}
.brand-wordmark-auth {
  height: 82px;
  max-width: min(360px, 86vw);
  margin: 0 auto 4px;
}
.brand-wordmark-sidebar {
  height: 48px;
  max-width: 190px;
  background: rgba(255,255,255,0.98);
  border-radius: 14px;
  padding: 8px 10px;
  box-shadow: var(--shadow-sm);
}
.brand-wordmark-mini {
  height: 42px;
  max-width: 220px;
  background: rgba(255,255,255,0.96);
  border-radius: 12px;
  padding: 6px 8px;
  box-shadow: 0 10px 24px rgba(0,0,0,0.10);
}
.admin-wordmark-row {
  justify-content: center;
  padding: 0 !important;
}
@media (max-width: 420px) {
  .brand-wordmark-header { height: 44px; max-width: 240px; }
  .brand-wordmark-auth { height: 70px; max-width: 320px; }
}
