/* PharmacyOM platform auth pages */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --green: #1b5e20;
  --green-2: #2e7d32;
  --orange: #e65100;
  --bg: #f4f7f5;
  --text: #1a1a1a;
  --muted: #667085;
  --border: #d8e0db;
  --card: #fff;
  --danger: #c62828;
}

body {
  font-family: 'Cairo', sans-serif;
  color: var(--text);
  background: var(--bg);
  min-height: 100vh;
  line-height: 1.6;
}

a { color: var(--green); text-decoration: none; }
a:hover { text-decoration: underline; }

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.9rem 1.25rem;
  background: linear-gradient(135deg, var(--green), var(--green-2));
  color: #fff;
}
.topbar a { color: #fff; text-decoration: none; font-weight: 700; }
.topbar-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  color: #fff;
  text-decoration: none;
}
.topbar-brand:hover { text-decoration: none; opacity: 0.95; }
.brand-flag {
  display: block;
  border-radius: 2px;
  box-shadow: 0 0 0 1px rgba(255,255,255,.25);
}
.topbar-nav { display: flex; gap: 0.65rem; flex-wrap: wrap; align-items: center; }
.nav-lang {
  display: inline-flex;
  gap: 0.2rem;
  padding: 0.15rem;
  border-radius: 8px;
  background: rgba(0,0,0,.12);
}
.nav-lang button {
  border: none;
  background: transparent;
  color: rgba(255,255,255,.85);
  font: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.25rem 0.45rem;
  border-radius: 6px;
  cursor: pointer;
}
.nav-lang button.is-active {
  background: rgba(255,255,255,.22);
  color: #fff;
}
.topbar-nav a {
  font-weight: 600;
  font-size: 0.92rem;
  padding: 0.4rem 0.85rem;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,.35);
}
.topbar-nav a.is-solid {
  background: var(--orange);
  border-color: var(--orange);
}

.auth-wrap {
  max-width: 34rem;
  margin: 2rem auto;
  padding: 0 1rem 3rem;
}

.auth-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1.75rem 1.5rem;
  box-shadow: 0 10px 30px rgba(27, 94, 32, 0.08);
}

.auth-card h1 {
  font-size: 1.45rem;
  color: var(--green);
  margin-bottom: 0.35rem;
}
.auth-card .lead {
  color: var(--muted);
  font-size: 0.95rem;
  margin-bottom: 1.25rem;
}

.form-group { margin-bottom: 0.95rem; }

.remember-row {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 0.45rem;
  margin-bottom: 0.95rem;
  font-weight: 500;
  font-size: 0.92rem;
  cursor: pointer;
  width: 100%;
}
.remember-row input[type="checkbox"] {
  width: auto;
  margin: 0;
  flex-shrink: 0;
}
.remember-row span { user-select: none; }

.form-group label {
  display: block;
  margin-bottom: 0.35rem;
  font-size: 0.9rem;
  font-weight: 600;
}
.form-group .hint {
  display: block;
  margin-top: 0.25rem;
  font-size: 0.8rem;
  color: var(--muted);
  font-weight: 400;
}
.form-group input {
  width: 100%;
  padding: 0.7rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  font: inherit;
  background: #fff;
}
.form-group input:focus {
  outline: 2px solid rgba(46, 125, 50, 0.25);
  border-color: var(--green-2);
}

.row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}
.row-2 > .form-group {
  min-width: 0;
  max-width: 100%;
}
@media (max-width: 560px) {
  .row-2 { grid-template-columns: 1fr; }
}

/* Phone + WhatsApp: stack so country dialer never overflows the card */
.auth-card .row-2.row-2--phones {
  grid-template-columns: 1fr;
}
.auth-card .phone-cc-field {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
}
.auth-card .phone-cc-local {
  width: 0 !important;
  flex: 1 1 0% !important;
  min-width: 0 !important;
  max-width: none !important;
}
.auth-card .phone-cc-trigger {
  min-width: 5.5rem;
  flex: 0 0 auto;
}

.otp-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.55rem;
  align-items: end;
}
.otp-row .form-group { margin-bottom: 0; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  padding: 0.75rem 1.2rem;
  border-radius: 10px;
  border: 1px solid transparent;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
}
.btn:disabled { opacity: 0.6; cursor: not-allowed; }
.btn-block { width: 100%; }
.btn-primary { background: var(--orange); color: #fff; }
.btn-primary:hover:not(:disabled) { filter: brightness(0.96); text-decoration: none; }
.btn-outline {
  background: #fff;
  border-color: var(--border);
  color: var(--green);
}
.btn-outline:hover:not(:disabled) { border-color: var(--green-2); text-decoration: none; }

.alert {
  padding: 0.75rem 0.9rem;
  border-radius: 10px;
  font-size: 0.9rem;
  margin-bottom: 1rem;
  display: none;
}
.alert.show { display: block; }
.alert-error { background: #ffebee; color: var(--danger); }
.alert-ok { background: #e8f5e9; color: #1b5e20; }
.alert-info { background: #eef6ff; color: #1565c0; }

.toast-stack {
  position: fixed;
  inset-block-start: 1rem;
  inset-inline-start: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  width: min(92vw, 28rem);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  pointer-events: none;
}
.toast-msg {
  pointer-events: auto;
  padding: 0.85rem 1rem;
  border-radius: 12px;
  font-weight: 700;
  font-size: 0.95rem;
  box-shadow: 0 10px 28px rgba(0,0,0,.18);
  animation: toast-in 0.2s ease;
}
.toast-msg.ok { background: #1b5e20; color: #fff; }
.toast-msg.error { background: #c62828; color: #fff; }
.toast-msg.info { background: #1565c0; color: #fff; }
@keyframes toast-in {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

.otp-dev-box {
  margin-top: 0.55rem;
  padding: 0.65rem 0.8rem;
  border-radius: 10px;
  background: #fff8e1;
  border: 1px solid #ffe082;
  color: #e65100;
  font-weight: 700;
  display: none;
}
.otp-dev-box.show { display: block; }

.auth-foot {
  margin-top: 1.1rem;
  text-align: center;
  color: var(--muted);
  font-size: 0.92rem;
}

.steps {
  display: flex;
  gap: 0.45rem;
  margin-bottom: 1.1rem;
  flex-wrap: wrap;
}
.step-chip {
  font-size: 0.78rem;
  padding: 0.25rem 0.55rem;
  border-radius: 999px;
  background: #eef3ef;
  color: var(--muted);
  font-weight: 600;
}
.step-chip.is-on { background: #e8f5e9; color: var(--green); }

.password-field { position: relative; }
.password-field input { padding-inline-end: 2.75rem; }
.toggle-password {
  position: absolute;
  inset-inline-end: 0.45rem;
  top: 50%;
  transform: translateY(-50%);
  border: none;
  background: none;
  cursor: pointer;
  color: var(--muted);
  font-size: 0.85rem;
  padding: 0.25rem;
}
