/* ─── Variables ─────────────────────────────────────────── */
:root {
  --primary:       #3D5A80;
  --primary-dark:  #2C4A6E;
  --primary-light: #EBF2FB;
  --accent:        #E07A5F;
  --accent-dark:   #C4614A;
  --bg:            #F4F1EC;
  --surface:       #FFFFFF;
  --text:          #22223B;
  --text-muted:    #6B6B7A;
  --border:        #DDD8CE;
  --error:         #C0392B;
  --error-bg:      #FDECEA;
  --success:       #27AE60;
  --success-bg:    #EAF7F0;
  --shadow:        0 4px 32px rgba(61, 90, 128, 0.13);
  --radius:        14px;
  --radius-sm:     9px;
  --tr:            0.2s ease;
}

/* ─── Reset & Base ──────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Vazirmatn', Tahoma, Arial, sans-serif;
  background: var(--bg);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  direction: rtl;
  padding: 16px;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

/* ─── Card ──────────────────────────────────────────────── */
.auth-wrapper { width: 100%; max-width: 440px; }

.auth-card {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 44px 40px;
  animation: slideUp 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

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

/* ─── Logo ──────────────────────────────────────────────── */
.auth-logo {
  text-align: center;
  margin-bottom: 32px;
}
.auth-logo .brand {
  font-size: 28px;
  font-weight: 800;
  color: var(--primary);
  letter-spacing: -1px;
}
.auth-logo .brand em {
  font-style: normal;
  color: var(--accent);
}
.auth-logo .tagline {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
  letter-spacing: 0.5px;
}

/* ─── Step Dots ─────────────────────────────────────────── */
.steps {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-bottom: 24px;
}
.step-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--border);
  transition: background var(--tr), transform var(--tr);
}
.step-dot.active  { background: var(--primary); transform: scale(1.3); }
.step-dot.done    { background: var(--success); }

/* ─── Headings ──────────────────────────────────────────── */
.auth-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
  text-align: center;
  margin-bottom: 6px;
}
.auth-subtitle {
  font-size: 13px;
  color: var(--text-muted);
  text-align: center;
  margin-bottom: 28px;
  line-height: 1.7;
}

/* ─── Form Elements ─────────────────────────────────────── */
.form-group { margin-bottom: 20px; }

.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 8px;
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="tel"] {
  width: 100%;
  padding: 13px 16px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-family: inherit;
  color: var(--text);
  background: var(--surface);
  transition: border-color var(--tr), box-shadow var(--tr);
  direction: ltr;
  text-align: right;
}
.form-group input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-light);
}
.form-group input.is-invalid { border-color: var(--error); }

.field-error {
  display: block;
  font-size: 12px;
  color: var(--error);
  margin-top: 5px;
}

/* ─── Phone Display ─────────────────────────────────────── */
.phone-display {
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 11px 20px;
  text-align: center;
  font-size: 18px;
  font-weight: 700;
  color: var(--primary);
  letter-spacing: 2px;
  direction: ltr;
  margin-bottom: 24px;
}

/* ─── OTP Boxes ─────────────────────────────────────────── */
.otp-group { margin-bottom: 8px; }

.otp-inputs {
  display: flex;
  gap: 10px;
  justify-content: center;
  direction: ltr;
}
.otp-inputs input {
  width: 54px;
  height: 60px;
  text-align: center;
  font-size: 24px;
  font-weight: 700;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--primary);
  background: var(--surface);
  transition: border-color var(--tr), box-shadow var(--tr), background var(--tr);
  caret-color: var(--accent);
}
.otp-inputs input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-light);
}
.otp-inputs input.filled {
  border-color: var(--primary);
  background: var(--primary-light);
}
.otp-inputs input.is-invalid {
  border-color: var(--error);
  background: var(--error-bg);
}

/* ─── OTP Timer ─────────────────────────────────────────── */
.otp-timer {
  text-align: center;
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 18px;
}
.otp-timer .time {
  color: var(--accent);
  font-weight: 700;
  font-size: 15px;
}
.otp-resend {
  display: none;
  background: none;
  border: none;
  font-family: inherit;
  font-size: 13px;
  color: var(--primary);
  font-weight: 600;
  cursor: pointer;
  text-decoration: underline;
}
.otp-resend:hover { color: var(--accent); }

/* ─── Buttons ───────────────────────────────────────────── */
.btn {
  display: block;
  width: 100%;
  padding: 14px;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  text-align: center;
  text-decoration: none;
  transition: background var(--tr), transform var(--tr), box-shadow var(--tr), opacity var(--tr);
  position: relative;
  overflow: hidden;
}
.btn-primary {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 3px 12px rgba(61, 90, 128, 0.3);
}
.btn-primary:hover:not(:disabled) {
  background: var(--primary-dark);
  box-shadow: 0 5px 18px rgba(61, 90, 128, 0.4);
  transform: translateY(-1px);
}
.btn-primary:active:not(:disabled) { transform: translateY(0); }
.btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  box-shadow: none;
}
.btn + .btn { margin-top: 10px; }

/* Loading spinner */
.btn-loading { color: transparent !important; }
.btn-loading::after {
  content: '';
  position: absolute;
  inset: 0;
  margin: auto;
  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;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ─── Alerts ────────────────────────────────────────────── */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  margin-bottom: 20px;
  line-height: 1.6;
}
.alert-error   { background: var(--error-bg);   color: var(--error);   border: 1px solid #F5C6C2; }
.alert-success { background: var(--success-bg); color: #1A6B3F;        border: 1px solid #A7E3C5; }
.alert-warning { background: #FFF8E6;            color: #7B5600;        border: 1px solid #FFE08A; }

/* ─── Footer / Links ────────────────────────────────────── */
.auth-footer {
  text-align: center;
  margin-top: 22px;
  font-size: 13px;
  color: var(--text-muted);
}
.auth-footer a {
  color: var(--primary);
  font-weight: 600;
  text-decoration: none;
}
.auth-footer a:hover { color: var(--accent); text-decoration: underline; }

/* ─── Divider ───────────────────────────────────────────── */
.divider {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text-muted);
  font-size: 12px;
  margin: 20px 0;
}
.divider::before, .divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* ─── Profile Page ──────────────────────────────────────── */
.profile-header {
  text-align: center;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 24px;
}
.avatar {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: var(--primary-light);
  color: var(--primary);
  font-size: 28px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 14px;
  border: 3px solid var(--primary);
}
.profile-name  { font-size: 20px; font-weight: 700; color: var(--text); margin-bottom: 4px; }
.profile-phone { font-size: 14px; color: var(--text-muted); direction: ltr; }

.info-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
  color: var(--text);
}
.info-row:last-child { border-bottom: none; }
.info-label { color: var(--text-muted); font-size: 12px; min-width: 100px; }

.btn-danger {
  background: #fff;
  color: var(--error);
  border: 1.5px solid var(--error);
  margin-top: 24px;
  transition: background var(--tr), color var(--tr);
}
.btn-danger:hover { background: var(--error); color: #fff; }

/* ─── Responsive ────────────────────────────────────────── */
@media (max-width: 480px) {
  .auth-card { padding: 32px 22px; }
  .otp-inputs input { width: 46px; height: 52px; font-size: 20px; }
}

/* Match the storefront design system */
:root {
  --primary: #1c1917;
  --primary-dark: #0c0a09;
  --primary-light: #f1ede7;
  --accent: #a16207;
  --accent-dark: #854d0e;
  --bg: #faf9f7;
  --text: #1c1917;
  --text-muted: #706b65;
  --border: #ded9d2;
  --shadow: 0 18px 55px rgba(28,25,23,.1);
  --radius: 20px;
}
.auth-card { border: 1px solid var(--border); }
.btn-primary { box-shadow: none; }
.btn-primary:hover:not(:disabled) { box-shadow: 0 10px 24px rgba(28,25,23,.16); }
