:root {
  --brand-primary: #0f766e;
  --brand-primary-deep: #042f2e;
  --brand-secondary: #292524;
  --brand-accent: #059669;
  --brand-coral: #be123c;
  --brand-highlight: #b45309;
  --brand-surface: #e7e5e4;
  --brand-ink: #1c1917;
  --brand-muted: #57534e;
  --brand-border: #d6d3d1;
}

html {
  scroll-behavior: smooth;
}

.hero-strip {
  color: #e7e5e4;
}

.hero-strip h1 {
  color: #ffffff;
}

body {
  font-family: "Cairo", "IBM Plex Sans Arabic", system-ui, sans-serif;
  color: var(--brand-ink);
  background-color: var(--brand-surface);
  background-image:
    radial-gradient(ellipse 100% 80% at 100% 0%, rgba(15, 118, 110, 0.08), transparent 48%),
    radial-gradient(ellipse 80% 60% at 0% 100%, rgba(87, 83, 78, 0.06), transparent 50%),
    linear-gradient(180deg, #fafaf9 0%, #f5f5f4 45%, #e7e5e4 100%);
  background-attachment: fixed;
}

::selection {
  background: rgba(15, 118, 110, 0.2);
  color: var(--brand-ink);
}

.brand-english {
  font-family: "Inter", system-ui, sans-serif;
  font-synthesis: none;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid rgba(15, 118, 110, 0.45);
  outline-offset: 2px;
}

input:not([type="checkbox"]):not([type="radio"]),
select,
textarea {
  border-color: #d6d3d1;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

input:not([type="checkbox"]):not([type="radio"]):focus,
select:focus,
textarea:focus {
  border-color: var(--brand-primary);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.15);
}

input[type="checkbox"] {
  accent-color: var(--brand-primary);
}

/* Chevron: muted / brand for hover+focus (encoded #57534e and #0f766e) */
.jusoor-select {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  width: 100%;
  min-height: 3rem;
  padding: 0.7rem 0.9rem 0.7rem 2.6rem;
  font-size: 0.9375rem;
  font-weight: 500;
  line-height: 1.5;
  letter-spacing: 0.01em;
  color: var(--brand-ink);
  -webkit-tap-highlight-color: transparent;
  background-color: #fcfcfc;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='10' viewBox='0 0 16 10' fill='none'%3E%3Cpath stroke='%2357534e' stroke-width='1.65' stroke-linecap='round' stroke-linejoin='round' d='M2 2.5L8 8.5L14 2.5'/%3E%3C/svg%3E"),
    linear-gradient(180deg, #ffffff 0%, #f7f6f4 100%);
  background-repeat: no-repeat, no-repeat;
  background-position: left 0.7rem center, 0 0;
  background-size: 16px 10px, 100% 100%;
  border: 1px solid #c9c4bf;
  border-radius: 0.75rem;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    0 1px 2px rgba(15, 23, 42, 0.05),
    0 0 0 0 rgba(15, 118, 110, 0);
  cursor: pointer;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease, transform 0.15s ease;
}

.jusoor-select:hover:not(:disabled):not(:focus) {
  border-color: #a3a199;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='10' viewBox='0 0 16 10' fill='none'%3E%3Cpath stroke='%230f766e' stroke-width='1.65' stroke-linecap='round' stroke-linejoin='round' d='M2 2.5L8 8.5L14 2.5'/%3E%3C/svg%3E"),
    linear-gradient(180deg, #ffffff 0%, #f3f2f0 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.85), 0 2px 6px rgba(15, 23, 42, 0.07);
}

.jusoor-select:focus,
.jusoor-select:focus-visible {
  outline: none;
  border-color: var(--brand-primary);
  color: #0c0a09;
  background-color: #fff;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='10' viewBox='0 0 16 10' fill='none'%3E%3Cpath stroke='%230f766e' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round' d='M2 2.5L8 8.5L14 2.5'/%3E%3C/svg%3E"),
    linear-gradient(180deg, #ffffff 0%, #fbfaf9 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.95), 0 0 0 3px rgba(15, 118, 110, 0.18);
}

.jusoor-select:disabled {
  cursor: not-allowed;
  opacity: 0.68;
  background: #f5f4f2;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='10' viewBox='0 0 16 10' fill='none'%3E%3Cpath stroke='%23a8a29e' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round' d='M2 2.5L8 8.5L14 2.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: left 0.7rem center;
  background-size: 16px 10px;
  border-color: #d6d3d1;
  box-shadow: none;
}

.jusoor-select::-ms-expand {
  display: none;
}

.jusoor-select option {
  font-weight: 500;
  padding: 0.4rem 0.5rem;
  background-color: #fff;
  color: var(--brand-ink);
}

/* Wrapper: subtle outer ring on focus (registration / forms) */
.jusoor-field {
  position: relative;
  border-radius: 0.875rem;
  transition: box-shadow 0.2s ease;
}

.jusoor-field:has(.jusoor-select:focus) {
  box-shadow: 0 0 0 1px rgba(15, 118, 110, 0.12);
}

.phone-opt {
  display: grid;
  grid-template-columns: 1.5rem 1fr auto;
  column-gap: 0.6rem;
  align-items: center;
  padding: 0.5rem 0.75rem;
  cursor: pointer;
  font-size: 0.875rem;
  color: var(--brand-ink);
  line-height: 1.2;
}

.phone-opt:hover,
.phone-opt.is-active {
  background: rgba(15, 118, 110, 0.08);
}

.phone-opt .phone-flag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.5rem;
  line-height: 1;
}

.phone-flag-img {
  width: 20px;
  height: 15px;
  object-fit: cover;
  border-radius: 2px;
  box-shadow: 0 0 0 1px rgba(15, 23, 42, 0.08);
  display: block;
}

.phone-flag-placeholder {
  font-size: 1rem;
  line-height: 1;
  color: var(--brand-muted);
}

.phone-opt .phone-name {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.phone-opt .phone-dial-ltr {
  color: var(--brand-muted);
  font-variant-numeric: tabular-nums;
  direction: ltr;
  unicode-bidi: isolate;
  font-size: 0.8rem;
}

.phone-trigger .phone-flag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  line-height: 1;
  width: 0.9rem;
}

.phone-trigger .phone-flag-img {
  width: 14px;
  height: 11px;
}

.phone-trigger .phone-dial {
  min-width: 0;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}

.profile-avatar-preview-wrap {
  position: relative;
}

.privacy-consent-dialog {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: none;
  align-items: flex-end;
  justify-content: center;
  padding: 0;
}

.privacy-consent-dialog[aria-hidden="false"] {
  display: flex;
}

@media (min-width: 640px) {
  .privacy-consent-dialog[aria-hidden="false"] {
    align-items: center;
    padding: 1rem;
  }
}

/* Register form validation */
.reg-input-error {
  border-color: #f87171 !important;
  box-shadow: 0 0 0 1px rgba(248, 113, 113, 0.35);
}

.reg-box-error {
  box-shadow: 0 0 0 2px rgba(248, 113, 113, 0.35);
  border-radius: 0.5rem;
}

#form-error[role="alert"] {
  border-radius: 0.5rem;
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #b91c1c;
  padding: 0.5rem 0.75rem;
}

#form-error[role="alert"]:empty,
#form-error[role="alert"].hidden {
  border: none;
  background: none;
  padding: 0;
}

.reg-pw-rule--ok {
  color: #0d9488;
}

.reg-pw-rule--ok .reg-pw-mark {
  color: #0d9488;
}

.reg-pw-rule--no {
  color: #64748b;
}
