/* =============================================================
   Hamraah v3.2 — Professional Authentication UI
   Modern glassmorphism design system with RTL support
   ============================================================= */

/* ---------- Design Tokens ---------- */
:root {
  --hamraah-primary: #6f42c1;
  --hamraah-primary-rgb: 111, 66, 193;
  --hamraah-primary-dark: #5a32a3;
  --hamraah-primary-light: #8b5fcf;
  --hamraah-primary-soft: rgba(111, 66, 193, 0.08);
  --hamraah-primary-glow: rgba(111, 66, 193, 0.25);

  --hamraah-text: #1e293b;
  --hamraah-text-muted: #64748b;
  --hamraah-text-light: #94a3b8;

  --hamraah-bg: #f1f5f9;
  --hamraah-bg-card: rgba(255, 255, 255, 0.85);
  --hamraah-border: #e2e8f0;
  --hamraah-border-focus: #6f42c1;

  --hamraah-success: #10b981;
  --hamraah-success-bg: #ecfdf5;
  --hamraah-danger: #ef4444;
  --hamraah-danger-bg: #fef2f2;
  --hamraah-warning: #f59e0b;
  --hamraah-warning-bg: #fffbeb;
  --hamraah-info: #3b82f6;
  --hamraah-info-bg: #eff6ff;

  --hamraah-radius: 12px;
  --hamraah-radius-sm: 8px;
  --hamraah-radius-lg: 16px;
  --hamraah-radius-xl: 24px;

  --hamraah-shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
  --hamraah-shadow: 0 4px 24px rgba(0,0,0,0.07), 0 1px 4px rgba(0,0,0,0.04);
  --hamraah-shadow-lg: 0 12px 48px rgba(0,0,0,0.12), 0 2px 8px rgba(0,0,0,0.06);
  --hamraah-shadow-glow: 0 0 0 3px var(--hamraah-primary-glow);

  --hamraah-font: 'IRANSans', 'Vazirmatn', 'Tahoma', 'Segoe UI', system-ui, -apple-system, sans-serif;
  --hamraah-font-size-xs: 0.75rem;
  --hamraah-font-size-sm: 0.8125rem;
  --hamraah-font-size-base: 0.9375rem;
  --hamraah-font-size-lg: 1.0625rem;
  --hamraah-font-size-xl: 1.3125rem;
  --hamraah-font-size-2xl: 1.625rem;

  --hamraah-transition: 200ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* ---------- Base Reset for Module Pages ---------- */
.hamraah-login-tabs,
.hamraah-register,
.hamraah-otp,
.hamraah-password-reset,
.hamraah-set-new-password {
  font-family: var(--hamraah-font);
  font-size: var(--hamraah-font-size-base);
  color: var(--hamraah-text);
  direction: rtl;
  text-align: right;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ---------- Card Wrapper ---------- */
.hamraah-card {
  background: var(--hamraah-bg-card);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255,255,255,0.6);
  border-radius: var(--hamraah-radius-xl);
  padding: 2.5rem;
  box-shadow: var(--hamraah-shadow-lg);
  max-width: 460px;
  margin: 2rem auto;
  animation: hamraah-fade-up 0.5s ease-out;
  position: relative;
  overflow: hidden;
}

.hamraah-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--hamraah-primary), var(--hamraah-primary-light), var(--hamraah-primary));
  border-radius: var(--hamraah-radius-xl) var(--hamraah-radius-xl) 0 0;
}

/* ---------- Shop Logo (✅ v3.5.1 — top of module front pages) ---------- */
.hamraah-shop-logo {
  text-align: center;
  margin: 0 0 1.5rem;
}

.hamraah-shop-logo a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 0;
  border-radius: var(--hamraah-radius);
  transition: transform var(--hamraah-transition);
}

.hamraah-shop-logo a:hover {
  transform: scale(1.03);
}

.hamraah-shop-logo img {
  max-height: 64px;
  max-width: 100%;
  width: auto;
  height: auto;
  display: block;
  border-radius: 4px;
}

/* ---------- Centered Button Wrapper (✅ v3.5.1) ----------
   جایگزین text-align:center — در RTL، دکمه inline-flex با width:100%
   داخل باکس inline با فاصله سفید، به چپ سرریز می‌کرد؛ flex این را
   برای همیشه حذف می‌کند و دکمه دقیقاً وسط می‌ماند. */
.hamraah-center-btn {
  display: flex;
  justify-content: center;
}

.hamraah-center-btn .hamraah-btn-primary {
  flex: 1 1 auto;
  max-width: 100%;
}

/* ---------- Brand Header ---------- */
.hamraah-brand {
  text-align: center;
  margin-bottom: 2rem;
}

.hamraah-brand-icon {
  width: 72px;
  height: 72px;
  margin: 0 auto 1rem;
  background: linear-gradient(135deg, var(--hamraah-primary), var(--hamraah-primary-light));
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 24px var(--hamraah-primary-glow), var(--hamraah-shadow);
  transition: transform var(--hamraah-transition);
}

.hamraah-brand-icon:hover {
  transform: translateY(-2px) scale(1.03);
}

.hamraah-brand-icon .material-icons {
  font-size: 36px;
  color: #fff;
}

.hamraah-brand-title {
  font-size: var(--hamraah-font-size-2xl);
  font-weight: 800;
  color: var(--hamraah-text);
  margin: 0 0 0.35rem;
  letter-spacing: -0.02em;
}

.hamraah-brand-subtitle {
  font-size: var(--hamraah-font-size-sm);
  color: var(--hamraah-text-muted);
  margin: 0;
  font-weight: 400;
}

/* ---------- Tab Navigation ---------- */
.hamraah-tabs-nav {
  display: flex;
  gap: 4px;
  background: var(--hamraah-bg);
  border-radius: var(--hamraah-radius);
  padding: 4px;
  margin-bottom: 1.75rem;
}

.hamraah-tab-item {
  flex: 1;
  list-style: none;
  margin: 0;
  padding: 0;
}

.hamraah-tab-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  padding: 0.625rem 1rem;
  background: transparent;
  border: none;
  border-radius: calc(var(--hamraah-radius) - 4px);
  font-family: var(--hamraah-font);
  font-size: var(--hamraah-font-size-sm);
  font-weight: 600;
  color: var(--hamraah-text-muted);
  cursor: pointer;
  transition: all var(--hamraah-transition);
  white-space: nowrap;
}

.hamraah-tab-btn .material-icons {
  font-size: 18px;
}

.hamraah-tab-btn:hover {
  color: var(--hamraah-primary);
  background: rgba(255,255,255,0.6);
}

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

.hamraah-tab-content {
  display: none;
}

.hamraah-tab-content.active {
  display: block;
  animation: hamraah-fade-up 0.3s ease-out;
}

/* ---------- Form Styling ---------- */
.hamraah-form {
  margin: 0;
}

.hamraah-form .form-group {
  margin-bottom: 1.25rem;
}

.hamraah-form .form-group.row {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
  margin-bottom: 1.25rem;
}

.hamraah-form .form-control-label {
  font-size: var(--hamraah-font-size-sm);
  font-weight: 600;
  color: var(--hamraah-text);
  padding: 0;
  margin-bottom: 0;
}

.hamraah-form .form-control-label.required::after {
  content: ' *';
  color: var(--hamraah-danger);
}

.hamraah-form .col-md-9,
.hamraah-form .col-md-3 {
  padding: 0;
  flex: none;
  width: 100%;
}

.hamraah-form .input-group {
  display: flex;
  border-radius: var(--hamraah-radius);
  overflow: hidden;
}

.hamraah-form .input-group-append {
  flex: 0 0 auto;
}

.hamraah-form .form-control {
  width: 100%;
  padding: 0.75rem 1rem;
  font-family: var(--hamraah-font);
  font-size: var(--hamraah-font-size-base);
  color: var(--hamraah-text);
  background: #fff;
  border: 1.5px solid var(--hamraah-border);
  border-radius: var(--hamraah-radius);
  transition: all var(--hamraah-transition);
  outline: none;
  box-sizing: border-box;
  height: auto;
}

.hamraah-form .form-control::placeholder {
  color: var(--hamraah-text-light);
  font-weight: 400;
}

.hamraah-form .form-control:hover {
  border-color: var(--hamraah-text-light);
}

.hamraah-form .form-control:focus {
  border-color: var(--hamraah-primary);
  box-shadow: var(--hamraah-shadow-glow);
  background: #fff;
}

.hamraah-form .form-control.is-invalid {
  border-color: var(--hamraah-danger);
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.15);
}

/* ---------- Toggle Password ---------- */
.hamraah-toggle-password {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  min-height: 100%;
  background: #fff;
  border: 1.5px solid var(--hamraah-border);
  border-right: none;
  color: var(--hamraah-text-muted);
  cursor: pointer;
  transition: all var(--hamraah-transition);
  font-size: 0;
  padding: 0;
}

[dir="ltr"] .hamraah-toggle-password {
  border-right: 1.5px solid var(--hamraah-border);
  border-left: none;
}

.hamraah-toggle-password:hover {
  color: var(--hamraah-primary);
  background: var(--hamraah-primary-soft);
}

.hamraah-toggle-password .material-icons {
  font-size: 20px;
}

/* ---------- Buttons ---------- */
.hamraah-btn-primary,
.hamraah-form .btn-primary,
.hamraah-form .btn.btn-primary.btn-lg {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0.8125rem 2rem;
  font-family: var(--hamraah-font);
  font-size: var(--hamraah-font-size-base);
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, var(--hamraah-primary), var(--hamraah-primary-light));
  border: none;
  border-radius: var(--hamraah-radius);
  cursor: pointer;
  transition: all var(--hamraah-transition);
  box-shadow: 0 4px 12px var(--hamraah-primary-glow);
  position: relative;
  overflow: hidden;
  min-height: 48px;
  text-decoration: none;
  /* ✅ v3.5.1: بدون border-box، width:100% + پدینگ افقی ۲rem در RTL
     به سمت چپ سرریز می‌کرد — علت «دکمه پایینی وسط نیست» */
  box-sizing: border-box;
}

.hamraah-btn-primary:hover,
.hamraah-form .btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px var(--hamraah-primary-glow);
  color: #fff;
}

.hamraah-btn-primary:active,
.hamraah-form .btn-primary:active {
  transform: translateY(0);
  box-shadow: 0 2px 8px var(--hamraah-primary-glow);
}

.hamraah-btn-primary .material-icons,
.hamraah-form .btn-primary .material-icons {
  font-size: 20px;
}

.hamraah-form .btn.btn-primary.btn-lg {
  padding: 1rem 2.5rem;
  font-size: var(--hamraah-font-size-lg);
  width: 100%;
  border-radius: var(--hamraah-radius);
  box-sizing: border-box;
}

/* ---------- Link Buttons ---------- */
.hamraah-forgot-link,
.hamraah-form .btn-link,
.hamraah-register .btn-link {
  font-family: var(--hamraah-font);
  font-size: var(--hamraah-font-size-sm);
  font-weight: 600;
  color: var(--hamraah-primary);
  text-decoration: none;
  padding: 0.5rem 0;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: color var(--hamraah-transition);
}

.hamraah-forgot-link:hover,
.hamraah-form .btn-link:hover {
  color: var(--hamraah-primary-dark);
  text-decoration: underline;
}

.hamraah-forgot-link .material-icons {
  font-size: 16px;
}

/* ---------- Form Row Actions ---------- */
.hamraah-form .form-group.row:last-child .col-md-9,
.hamraah-form .form-group.row:last-child .offset-md-3 {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  width: 100%;
  padding: 0;
  margin: 0;
  offset-distance: 0;
}

.hamraah-form .d-flex {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
}

/* ---------- Alerts ---------- */
.hamraah-card .alert {
  border-radius: var(--hamraah-radius);
  padding: 0.875rem 1rem;
  font-size: var(--hamraah-font-size-sm);
  border: none;
  margin-bottom: 1.25rem;
  animation: hamraah-shake 0.4s ease-in-out;
}

.hamraah-card .alert-danger {
  background: var(--hamraah-danger-bg);
  color: #b91c1c;
  border-right: 4px solid var(--hamraah-danger);
}

[dir="ltr"] .hamraah-card .alert-danger {
  border-right: none;
  border-left: 4px solid var(--hamraah-danger);
}

.hamraah-card .alert-success {
  background: var(--hamraah-success-bg);
  color: #047857;
  border-right: 4px solid var(--hamraah-success);
}

[dir="ltr"] .hamraah-card .alert-success {
  border-right: none;
  border-left: 4px solid var(--hamraah-success);
}

.hamraah-card .alert-info {
  background: var(--hamraah-info-bg);
  color: #1d4ed8;
  border-right: 4px solid var(--hamraah-info);
}

[dir="ltr"] .hamraah-card .alert-info {
  border-right: none;
  border-left: 4px solid var(--hamraah-info);
}

.hamraah-card .alert ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.hamraah-card .alert ul li {
  position: relative;
  padding-right: 1.25rem;
}

[dir="ltr"] .hamraah-card .alert ul li {
  padding-right: 0;
  padding-left: 1.25rem;
}

.hamraah-card .alert ul li::before {
  content: '•';
  position: absolute;
  right: 0;
  font-weight: 700;
}

[dir="ltr"] .hamraah-card .alert ul li::before {
  right: auto;
  left: 0;
}

/* ---------- Divider ---------- */
.hamraah-divider {
  display: flex;
  align-items: center;
  margin: 1.75rem 0;
  gap: 1rem;
}

.hamraah-divider::before,
.hamraah-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--hamraah-border);
}

.hamraah-divider span {
  font-size: var(--hamraah-font-size-xs);
  color: var(--hamraah-text-muted);
  font-weight: 500;
  white-space: nowrap;
}

/* ---------- Checkbox / Terms ---------- */
.hamraah-form .checkbox {
  padding: 0;
  margin: 0 0 1.25rem;
}

.hamraah-form .checkbox label {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  font-size: var(--hamraah-font-size-sm);
  color: var(--hamraah-text-muted);
  cursor: pointer;
  line-height: 1.5;
}

.hamraah-form .checkbox input[type="checkbox"] {
  width: 18px;
  height: 18px;
  min-width: 18px;
  margin-top: 2px;
  accent-color: var(--hamraah-primary);
  cursor: pointer;
}

/* ---------- Select Dropdown ---------- */
.hamraah-form .form-control[multiple],
.hamraah-form select.form-control {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2364748b' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: left 12px center;
  padding-left: 2.25rem;
}

[dir="ltr"] .hamraah-form select.form-control {
  background-position: right 12px center;
  padding-left: 1rem;
  padding-right: 2.25rem;
}

/* ---------- OTP Input ---------- */
.hamraah-otp-input {
  text-align: center !important;
  font-size: 1.5rem !important;
  font-weight: 700 !important;
  letter-spacing: 0.5em !important;
  padding: 1rem 0.5rem !important;
  border-radius: var(--hamraah-radius-lg) !important;
  background: var(--hamraah-bg) !important;
}

/* ---------- Resend Button ---------- */
.hamraah-resend-btn {
  font-family: var(--hamraah-font) !important;
  font-size: var(--hamraah-font-size-sm) !important;
  font-weight: 600 !important;
  color: var(--hamraah-primary) !important;
  padding: 0.5rem 1rem !important;
  transition: all var(--hamraah-transition);
}

.hamraah-resend-btn.disabled,
.hamraah-resend-btn[aria-disabled="true"] {
  opacity: 0.4;
  pointer-events: none;
}

/* ---------- Password Strength Meter ---------- */
.hamraah-password-meter {
  margin-top: 0.5rem;
}

.hamraah-password-meter-bar {
  height: 5px;
  background: var(--hamraah-border);
  border-radius: 999px;
  overflow: hidden;
}

.hamraah-password-meter-bar span {
  display: block;
  height: 100%;
  width: 0%;
  border-radius: 999px;
  transition: width 0.4s ease, background 0.4s ease;
}

.hamraah-password-meter-text {
  display: block;
  margin-top: 0.375rem;
  font-size: var(--hamraah-font-size-xs);
  font-weight: 500;
}

/* ---------- Card Header Override (for OTP/PasswordReset) ---------- */
.hamraah-card .card {
  background: transparent;
  border: none;
  box-shadow: none;
  border-radius: 0;
}

.hamraah-card .card-header {
  background: transparent;
  border-bottom: 1px solid var(--hamraah-border);
  padding: 0 0 1.25rem;
  margin-bottom: 1.25rem;
}

.hamraah-card .card-body {
  padding: 0;
}

.hamraah-card .card-title {
  font-family: var(--hamraah-font);
  font-weight: 700;
}

/* ---------- Form Text / Help ---------- */
.hamraah-form .form-text {
  font-size: var(--hamraah-font-size-xs);
  color: var(--hamraah-text-light);
  margin-top: 0.375rem;
}

/* ---------- Password Strength (set-new-password) ---------- */
.hamraah-password-strength .progress {
  height: 5px;
  border-radius: 999px;
  background: var(--hamraah-border);
  overflow: hidden;
}

.hamraah-password-strength .progress-bar {
  border-radius: 999px;
  transition: width 0.4s ease, background 0.4s ease;
}

.hamraah-strength-label {
  font-size: var(--hamraah-font-size-xs);
}

.hamraah-match-feedback {
  font-size: var(--hamraah-font-size-xs);
  min-height: 1.2em;
}

/* ---------- Toast ---------- */
.hamraah-toast {
  position: fixed;
  top: 1.5rem;
  left: 50%;
  transform: translateX(-50%) translateY(-100%);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.875rem 1.5rem;
  border-radius: var(--hamraah-radius);
  font-family: var(--hamraah-font);
  font-size: var(--hamraah-font-size-sm);
  font-weight: 500;
  color: #fff;
  z-index: 99999;
  animation: hamraah-toast-in 0.4s ease-out forwards;
  box-shadow: var(--hamraah-shadow-lg);
  max-width: 90vw;
}

.toast-success { background: var(--hamraah-success); }
.toast-error { background: var(--hamraah-danger); }
.toast-info { background: var(--hamraah-info); }
.toast-warning { background: var(--hamraah-warning); }

.hamraah-toast .material-icons {
  font-size: 20px;
}

/* ---------- Forgot Password Note ---------- */
.hamraah-forgot-note {
  background: var(--hamraah-info-bg);
  border-radius: var(--hamraah-radius);
  padding: 1rem;
  margin-bottom: 1.25rem;
  font-size: var(--hamraah-font-size-sm);
  color: #1e40af;
  border-right: 3px solid var(--hamraah-info);
}

[dir="ltr"] .hamraah-forgot-note {
  border-right: none;
  border-left: 3px solid var(--hamraah-info);
}

/* ---------- Email Tab Placeholder ---------- */
.hamraah-email-login-placeholder {
  text-align: center;
  padding: 2rem 0;
}

.hamraah-email-login-placeholder .alert {
  margin-bottom: 1.25rem;
}

/* ---------- Animations ---------- */
@keyframes hamraah-fade-up {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes hamraah-shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-6px); }
  40% { transform: translateX(6px); }
  60% { transform: translateX(-4px); }
  80% { transform: translateX(4px); }
}

@keyframes hamraah-toast-in {
  0% {
    opacity: 0;
    transform: translateX(-50%) translateY(-100%);
  }
  100% {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
}

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

/* ---------- Responsive ---------- */
@media (max-width: 768px) {
  .hamraah-card {
    padding: 1.5rem;
    margin: 1rem 0.5rem;
    border-radius: var(--hamraah-radius-lg);
  }

  .hamraah-shop-logo {
    margin-bottom: 1.25rem;
  }

  .hamraah-shop-logo img {
    max-height: 52px;
  }

  .hamraah-brand-icon {
    width: 60px;
    height: 60px;
    border-radius: 16px;
  }

  .hamraah-brand-icon .material-icons {
    font-size: 28px;
  }

  .hamraah-brand-title {
    font-size: var(--hamraah-font-size-xl);
  }

  .hamraah-form .btn.btn-primary.btn-lg {
    padding: 0.875rem 2rem;
  }
}

@media (max-width: 400px) {
  .hamraah-card {
    padding: 1.25rem;
    margin: 0.5rem 0.25rem;
  }

  .hamraah-tabs-nav {
    gap: 2px;
    padding: 3px;
  }

  .hamraah-tab-btn {
    font-size: var(--hamraah-font-size-xs);
    padding: 0.5rem 0.5rem;
  }

  .hamraah-tab-btn .material-icons {
    display: none;
  }
}

/* ---------- Print ---------- */
@media print {
  .hamraah-login-tabs,
  .hamraah-register,
  .hamraah-otp,
  .hamraah-password-reset,
  .hamraah-set-new-password {
    display: none;
  }
}

/* ---------- Accessibility ---------- */
.hamraah-tab-btn:focus-visible,
.hamraah-form .form-control:focus-visible,
.hamraah-form .btn:focus-visible,
.hamraah-btn:focus-visible,
.hamraah-toggle-password:focus-visible {
  outline: 2px solid var(--hamraah-primary);
  outline-offset: 2px;
}

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

/* ---------- Override PrestaShop Defaults on Module Pages ---------- */
body#authentication .login-form:not(.hamraah-moved),
body#authentication #login-form:not(.hamraah-moved),
body#authentication form#login-form:not(.hamraah-moved),
body#authentication section.login-form:not(.hamraah-moved) {
  display: none !important;
}

body#authentication .no-account hr,
body#authentication > hr {
  display: none !important;
}

body#registration .register-form,
body#registration #customer-form,
body#registration form#customer-form,
body#registration section.register-form,
body#registration .section-register-form,
body#registration .customer-form {
  display: none !important;
}

/* =============================================================
   ✅ v3.8.0 — Checkout Compact Card
   کارت ورود فشرده در مرحلهٔ «اطلاعات شخصی» چک‌اوت
   (هوک displayPersonalInformationTop)
   ============================================================= */

.hamraah-checkout-card {
  font-family: var(--hamraah-font);
  direction: rtl;
  background: #ffffff;
  border: 1px solid var(--hamraah-border);
  border-radius: var(--hamraah-radius);
  padding: 18px 20px;
  margin: 0 0 18px 0;
  box-shadow: var(--hamraah-shadow-sm);
  box-sizing: border-box;
}

.hamraah-checkout-card *,
.hamraah-checkout-card *::before,
.hamraah-checkout-card *::after {
  box-sizing: border-box;
}

.hamraah-checkout-card-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.hamraah-checkout-card-icon {
  flex: 0 0 auto;
  width: 42px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  background: var(--hamraah-primary-soft);
  color: var(--hamraah-primary);
}

.hamraah-checkout-card-icon .material-icons {
  font-size: 22px;
}

.hamraah-checkout-card-titles {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.hamraah-checkout-card-titles strong {
  color: var(--hamraah-text);
  font-size: var(--hamraah-font-size-base);
  font-weight: 700;
}

.hamraah-checkout-card-titles small {
  color: var(--hamraah-text-muted);
  font-size: var(--hamraah-font-size-xs);
}

.hamraah-checkout-field {
  position: relative;
  margin-bottom: 10px;
}

.hamraah-checkout-field .form-control {
  width: 100%;
  height: 46px;
  padding: 0 44px 0 14px;
  border: 1px solid var(--hamraah-border);
  border-radius: var(--hamraah-radius-sm);
  background: #fff;
  color: var(--hamraah-text);
  font-family: var(--hamraah-font);
  font-size: var(--hamraah-font-size-base);
  transition: border-color var(--hamraah-transition), box-shadow var(--hamraah-transition);
}

/* RTL: متن از راست، دکمه چشم در سمت چپ فیلد */
body.rtl .hamraah-checkout-field .form-control,
[dir="rtl"] .hamraah-checkout-field .form-control {
  padding: 0 14px 0 44px;
  text-align: right;
}

.hamraah-checkout-field .form-control:focus {
  outline: none;
  border-color: var(--hamraah-border-focus);
  box-shadow: var(--hamraah-shadow-glow);
}

.hamraah-checkout-field .hamraah-toggle-password {
  position: absolute;
  top: 50%;
  inset-inline-end: 10px;
  right: 10px;
  transform: translateY(-50%);
  border: none;
  background: transparent;
  color: var(--hamraah-text-light);
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
}

[dir="rtl"] .hamraah-checkout-field .hamraah-toggle-password {
  right: auto;
  left: 10px;
}

.hamraah-checkout-field .hamraah-toggle-password .material-icons {
  font-size: 18px;
}

.hamraah-checkout-submit {
  width: 100%;
  height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 2px;
  font-family: var(--hamraah-font);
  font-size: var(--hamraah-font-size-base);
  font-weight: 700;
  border: none;
  cursor: pointer;
  transition: filter var(--hamraah-transition), transform var(--hamraah-transition);
}

.hamraah-checkout-submit .material-icons {
  font-size: 19px;
}

.hamraah-checkout-submit:hover {
  filter: brightness(1.06);
}

.hamraah-checkout-links {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.hamraah-checkout-links a {
  color: var(--hamraah-primary);
  font-size: var(--hamraah-font-size-sm);
  text-decoration: none;
  border-bottom: 1px dashed var(--hamraah-primary-light);
}

.hamraah-checkout-links a:hover {
  color: var(--hamraah-primary-dark);
  border-bottom-style: solid;
}

.hamraah-checkout-links-sep {
  color: var(--hamraah-text-light);
  font-size: var(--hamraah-font-size-sm);
}

/* حالت موبایل — فشرده‌تر */
@media (max-width: 575px) {
  .hamraah-checkout-card {
    padding: 14px;
    margin-bottom: 14px;
  }

  .hamraah-checkout-card-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
  }

  .hamraah-checkout-links {
    gap: 6px;
  }
}

/* ============================================================
 * ✅ v3.9.2 — پشتیبان CSS برای «مخفی‌سازی فرم ورود استاندارد چک‌اوت»
 *
 * منطق اصلی در JS کارت (checkout-card.tpl) است؛ این قواعد به‌عنوان
 * لایهٔ دوم حتی بدون JS (یا قبل از اجرای JS → بدون فلش بصری) اعمال
 * می‌شوند. فقط وقتی کلاس hamraah-checkout-hide-standard روی کارت
 * باشد (یعنی مدیر خواسته فرم استاندارد پنهان شود).
 *
 * هدف‌ها (فرزندانِ خواهرهای بعدی کارت — ساختار استاندارد قالب‌های PS):
 *   - پنل فرم ورود:  #checkout-login-form
 *   - تب «ورود»:      a[href="#checkout-login-form"]
 * ساختار قالب متفاوت باشد → قاعده بی‌اثر و بی‌خطر (JS پوشش می‌دهد).
 * ============================================================ */
.hamraah-checkout-card.hamraah-checkout-hide-standard ~ .tab-content #checkout-login-form,
.hamraah-checkout-card.hamraah-checkout-hide-standard ~ .tab-pane #checkout-login-form,
.hamraah-checkout-card.hamraah-checkout-hide-standard ~ .nav a[href="#checkout-login-form"],
.hamraah-checkout-card.hamraah-checkout-hide-standard ~ .nav li a[data-link-action="show-login-form"],
.hamraah-checkout-card.hamraah-checkout-hide-standard ~ ul a[href="#checkout-login-form"] {
  display: none !important;
}

/* ============================================================
 * ✅ v3.9.3 — حالت Takeover: همراه تنها رابط مرحلهٔ ۱ چک‌اوت
 *
 * کارت همراه کلاس hamraah-checkout-takeover دارد؛ JS همهٔ فرم‌های
 * استاندارد همان مرحله را با کلاس hamraah-core-hidden نشانه‌گذاری
 * می‌کند. این قواعد لایهٔ دوم CSS هستند — حتی قبل از اجرای JS
 * (بدون فلش بصری) تب‌ها و پنل‌های استانداردِ بعد از کارت پنهان‌اند.
 *
 * JS لایهٔ اصلی است (پوشش قالب‌های غیراستاندارد)؛ این CSS فقط
 * ساختار استاندارد هسته را پوشش می‌دهد — اگر ساختار متفاوت بود
 * قاعده بی‌اثر و بی‌خطر است.
 * ============================================================ */
.hamraah-checkout-card.hamraah-checkout-takeover ~ .nav-tabs,
.hamraah-checkout-card.hamraah-checkout-takeover ~ .tab-content,
.hamraah-checkout-card.hamraah-checkout-takeover ~ form,
.hamraah-checkout-card.hamraah-checkout-takeover ~ .login-form,
.hamraah-checkout-card.hamraah-checkout-takeover ~ ul:not(.hamraah-checkout-links) {
  display: none !important;
}

/* عناصر نشانه‌گذاری‌شده توسط JS (هستهٔ سازگاری قالب‌های سفارشی) */
.hamraah-core-hidden {
  display: none !important;
}

/* پیام خطای کارت چک‌اوت (بازگشت از checkoutauth) */
.hamraah-checkout-error {
  margin: 0 0 10px 0;
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 0.95em;
  line-height: 1.6;
}

/* فیلد شناسهٔ دو‌حالته (موبایل یا ایمیل) */
.hamraah-checkout-takeover .hamraah-checkout-field input[type="text"] {
  direction: ltr;
  text-align: left;
  unicode-bidi: plaintext;
}
