:root {
  /* Your palette */
  --primary: #594534;
  --primary-2: #3f3026; /* مهم للزر */
  --secondary: #a4978d;
  --highlight: #d7ccc4;
  --highlightDark: #c19877;
  --whiteWarm: #ebe7df;
  --solidWhite: #ffffff;
  --teritary: #efefef;
  --borderColor: #201b17;
  --borderColor2: #d9dbe9;
  --brown: #322a23;
  --lightBrown: #fdf9f5;
  --backgroundLight: #fafafa;

  /* App tokens */
  --bg: var(--backgroundLight);
  --card: var(--solidWhite);
  --text: var(--brown);
  --muted: rgba(50, 42, 35, 0.72);

  --danger: #e74c3c;
  --success: #18a558;

  --border: rgba(32, 27, 23, 0.16);
  --shadow: 0 14px 34px rgba(32, 27, 23, 0.12);
  --radius: 18px;
}

* {
  box-sizing: border-box;
}
html,
body {
  height: 100%;
}

body {
  margin: 0;
  font-family:
    system-ui,
    -apple-system,
    Segoe UI,
    Roboto,
    Arial,
    sans-serif;
  background:
    radial-gradient(
      900px 450px at 12% 0%,
      rgba(215, 204, 196, 0.7),
      transparent 60%
    ),
    radial-gradient(
      900px 450px at 90% 10%,
      rgba(193, 152, 119, 0.22),
      transparent 55%
    ),
    linear-gradient(180deg, rgba(253, 249, 245, 0.9), rgba(250, 250, 250, 1));
  color: var(--text);
}

.wrap {
  min-height: 100%;
  display: grid;
  place-items: center;
  padding: 26px 14px;
}

.card {
  width: min(640px, 100%);
  background: var(--card);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  border-radius: var(--radius);
  overflow: hidden;
}

.topbar {
  display: flex;
  gap: 14px;
  align-items: center;
  justify-content: space-between;
  padding: 16px 18px;
  border-bottom: 1px solid rgba(32, 27, 23, 0.1);
  background: linear-gradient(
    90deg,
    rgba(215, 204, 196, 0.45),
    rgba(235, 231, 223, 0.7)
  );
}

.topbar-left {
  display: flex;
  gap: 12px;
  align-items: center;
}

.brand-dot {
  width: 34px;
  height: 34px;
  border-radius: 12px;
  background: linear-gradient(180deg, var(--highlightDark), var(--primary));
  box-shadow: 0 10px 20px rgba(32, 27, 23, 0.12);
}

.topbar-title {
  font-weight: 900;
  font-size: 14px;
  color: var(--text);
}

.topbar-sub {
  font-size: 12.5px;
  color: var(--muted);
  margin-top: 2px;
}

.lang-box {
  display: flex;
  align-items: center;
  gap: 8px;
}

.lang-label {
  font-size: 13px;
  color: var(--muted);
}

.lang-select {
  border: 1px solid rgba(32, 27, 23, 0.18);
  border-radius: 12px;
  padding: 9px 10px;
  background: rgba(255, 255, 255, 0.85);
  color: var(--text);
  outline: none;
}

.hero {
  padding: 18px 18px 6px;
  text-align: center;
}

.hero h1 {
  margin: 0;
  font-size: clamp(20px, 4vw, 30px);
  line-height: 1.2;
  letter-spacing: -0.2px;
}

.hero p {
  margin: 10px 0 0;
  color: var(--muted);
}

/* ✅ أقل gap بين inputs */
.form {
  padding: 18px;
  display: grid;
  gap: 10px; /* كان 14 */
}

.field {
  display: grid;
  gap: 6px;
} /* كان 8 */

label {
  font-size: 14px;
  font-weight: 800;
}

input {
  width: 100%;
  padding: 12px 12px;
  border-radius: 14px;
  border: 1px solid rgba(32, 27, 23, 0.18);
  outline: none;
  font-size: 14px;
  background: rgba(255, 255, 255, 0.95);
  transition:
    border-color 0.15s ease,
    box-shadow 0.15s ease;
}

input:focus {
  border-color: rgba(89, 69, 52, 0.55);
  box-shadow: 0 0 0 5px rgba(89, 69, 52, 0.1);
}

input.invalid {
  border-color: rgba(231, 76, 60, 0.7);
  box-shadow: 0 0 0 5px rgba(231, 76, 60, 0.08);
}

.hint {
  min-height: 14px;
  font-size: 12px;
  color: var(--danger);
}

.btn {
  width: 100%;
  border: 0;
  border-radius: 14px;
  padding: 13px 14px;
  background: linear-gradient(180deg, var(--primary), var(--primary-2));
  color: #fff;
  font-weight: 900;
  font-size: 15px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  box-shadow: 0 14px 28px rgba(32, 27, 23, 0.16);
  transition:
    transform 0.06s ease,
    opacity 0.15s ease,
    filter 0.15s ease;
}

.btn:hover {
  filter: brightness(1.02);
}
.btn:active {
  transform: translateY(1px);
}

.btn[disabled] {
  opacity: 0.7;
  cursor: not-allowed;
  box-shadow: none;
}

.btn-spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.55);
  border-top-color: #fff;
  border-radius: 999px;
  display: none;
  animation: spin 0.8s linear infinite;
}

.cta {
  margin: 6px 0 0;
  font-size: 13px;
  color: var(--muted);
  text-align: center;
  line-height: 1.7;
}

.cta-highlight {
  color: var(--text);
  font-weight: 900;
}

.footer {
  margin-top: 14px;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

/* Success */
.success {
  padding: 18px;
}
.success-inner {
  border: 1px solid rgba(24, 165, 88, 0.18);
  background: rgba(24, 165, 88, 0.06);
  border-radius: 16px;
  padding: 16px;
  text-align: center;
}

.success-icon {
  width: 46px;
  height: 46px;
  margin: 0 auto 10px;
  border-radius: 999px;
  background: rgba(24, 165, 88, 0.18);
  display: grid;
  place-items: center;
  font-weight: 1000;
  color: var(--success);
  font-size: 20px;
}

.success-note {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 13px;
}

/* Toasts */
.toast-root {
  position: fixed;
  top: 14px;
  inset-inline-start: 14px;
  z-index: 9999;
  display: grid;
  gap: 10px;
  width: min(360px, calc(100vw - 28px));
}

html[dir="ltr"] .toast-root {
  inset-inline-start: auto;
  inset-inline-end: 14px;
}

.toast {
  border: 1px solid rgba(32, 27, 23, 0.16);
  background: #fff;
  border-radius: 16px;
  box-shadow: var(--shadow);
  padding: 12px 12px;
  display: grid;
  gap: 6px;
}

.toast-row {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 10px;
}

.toast-title {
  font-weight: 1000;
  font-size: 13px;
}
.toast-msg {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.toast-close {
  background: transparent;
  border: 0;
  cursor: pointer;
  color: var(--muted);
  font-size: 18px;
  line-height: 1;
}

.toast.error {
  border-color: rgba(231, 76, 60, 0.25);
}
.toast.success {
  border-color: rgba(24, 165, 88, 0.22);
}

/* Page Loader */
.page-loader {
  position: fixed;
  inset: 0;
  background: rgba(235, 231, 223, 0.7);
  backdrop-filter: blur(8px);
  display: grid;
  place-items: center;
  z-index: 9998;
}

.loader-card {
  background: #fff;
  border: 1px solid rgba(32, 27, 23, 0.16);
  box-shadow: var(--shadow);
  border-radius: 18px;
  padding: 16px 18px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.loader-text {
  color: var(--muted);
  font-weight: 900;
  font-size: 14px;
}

.spinner {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(32, 27, 23, 0.18);
  border-top-color: rgba(89, 69, 52, 0.95);
  border-radius: 999px;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* intl-tel-input */
.iti {
  width: 100%;
  direction: ltr;
} /* مهم مع RTL */
.iti input {
  direction: ltr;
  text-align: left;
}
