/* =========  Theme-friendly variables (with safe fallbacks)  ========= */
:root {
  /* Tries Blocksy palette vars first, then falls back to teal palette */
  --accent: var(--paletteColor1, var(--theme-palette-color-1, #0a7c86));
  --accent-strong: #005a63;
  --surface: var(--paletteColor7, #ffffff);
  --text: var(--colorText, var(--paletteColor3, #1f2937));
  --muted: var(--colorMuted, #6b7280);
  --border: var(--colorBorder, #e5e7eb);
  --radius: 14px;
  --shadow-sm: 0 6px 18px rgba(0,0,0,.06);
}

/* =========  OTP / Login card  ========= */
.otp-outer {
  direction: rtl;
  padding: clamp(12px, 3vw, 24px);
}
.otp-outer .otp-card {
  max-width: 420px;
  margin: 4vh auto 8vh;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: clamp(16px, 4vw, 28px);
}

.otp-title {
  margin: 0 0 .75rem;
  font-size: clamp(1.35rem, 2.3vw, 1.75rem);
  line-height: 1.2;
  color: var(--accent);
  text-align: center;
  font-weight: 700;
}

.form-group { margin-bottom: 14px; }
.form-label  { display:block; margin-bottom: 6px; color: var(--muted); font-weight:600; }

.form-control {
  width: 100%;
  appearance: none;
  -webkit-appearance: none;
  background: #fff;
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 14px;
  font-size: 16px;
  line-height: 1.4;
  text-align: right;
  direction: rtl;
  transition: border-color .2s, box-shadow .2s;
}
.form-control::placeholder { color: #b6b8bd; }
.form-control:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 .2rem color-mix(in srgb, var(--accent) 25%, transparent);
}

.btn-primary {
  display:block;
  width:100%;
  border:0;
  border-radius: 12px;
  background: linear-gradient(90deg, var(--accent), var(--accent-strong));
  color:#fff;
  font-weight:700;
  padding: 12px 16px;
  cursor:pointer;
  transition: transform .06s ease, filter .2s ease;
}
.btn-primary:hover { filter: brightness(1.06); }
.btn-primary:active { transform: translateY(1px); }

.error-message {
  background: #fde8ea;
  color: #b4232a;
  border: 1px solid #f5c2c7;
  border-radius: 10px;
  padding: 10px 12px;
  margin: 10px 0 12px;
  text-align:center;
  font-weight:600;
}

/* Countdown line */
.otp-meta {
  margin-top: 10px;
  text-align:center;
  color: var(--muted);
  font-size: 14px;
}
#countdown { font-weight: 700; color: var(--accent); }

/* Avoid bottom nav overlap on mobile */
.otp-outer { padding-bottom: 92px; }

/* =========  Orders grid  ========= */
.my-orders-container {
  direction: rtl;
  max-width: 1100px;
  margin: 2rem auto 6rem;
  padding: 0 clamp(10px, 2vw, 20px);
}
.orders-title {
  font-size: clamp(1.6rem, 3vw, 2rem);
  color: var(--accent);
  text-align: center;
  margin: 0 0 1.25rem;
  font-weight: 800;
}
.orders-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: clamp(12px, 2.5vw, 20px);
}
.order-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 16px 16px 12px;
}
.order-card-header {
  display:flex; justify-content:space-between; align-items:center;
  gap: 8px; color: var(--muted); font-size: .95rem; margin-bottom: 10px;
}
.order-card-body { color: var(--text); font-size: .98rem; }

.status-badge {
  display:inline-block; padding: 4px 10px; border-radius: 999px; color:#fff; font-size: .82rem;
}
.status-completed  { background:#28a745; }
.status-processing { background:#17a2b8; }
.status-pending    { background:#ffc107; color:#212529; }
.status-on-hold    { background:#6c757d; }
.status-failed     { background:#dc3545; }
.status-cancelled,
.status-refunded   { background:#6c757d; }

.order-card-footer {
  display:flex; justify-content:flex-end; gap: 8px; margin-top: 10px;
}
.order-btn {
  text-decoration:none; padding: 8px 12px; border-radius:10px;
  background: linear-gradient(90deg, var(--accent), var(--accent-strong));
  color:#fff; font-size:.85rem;
}

.logout-container { text-align:center; margin-top: 18px; }
.logout-button { color:#dc3545; font-weight:700; text-decoration:underline; }

/* Small phones */
@media (max-width: 420px) {
  .otp-outer .otp-card { margin: 2vh auto 7.5rem; }
  .order-card-header { flex-direction: column; align-items:flex-start; gap:4px; }
}
