:root {
  --orange: #ef5a21;
  --teal: #1aa39a;
  --font: "Cairo", "Segoe UI", Tahoma, sans-serif;
}

html[data-theme="light"] {
  --bg: #f5efe5;
  --panel: #fffdf9;
  --card: #ffffff;
  --ink: #12263a;
  --muted: #637181;
  --line: #e5dacb;
  --input: #fbf8f3;
  --shadow: rgba(22, 53, 92, 0.1);
}

html[data-theme="dark"] {
  --bg: #091522;
  --panel: #0f1e2e;
  --card: #152638;
  --ink: #fff8ee;
  --muted: #b7c5d2;
  --line: #2a3e54;
  --input: #112235;
  --shadow: rgba(0, 0, 0, 0.28);
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-weight: 700;
}
button,
input,
select { font: inherit; }

.auth-site-header {
  position: sticky;
  z-index: 30;
  top: 0;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--panel) 91%, transparent);
  backdrop-filter: blur(18px);
}
.auth-site-header-inner {
  width: min(1380px, calc(100% - 40px));
  height: 78px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin: 0 auto;
}
.auth-header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}
.auth-home-link,
.auth-account-link {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 16px;
  border-radius: 13px;
  color: var(--ink);
  font-size: 11px;
  font-weight: 900;
  text-decoration: none;
}
.auth-home-link:hover { background: var(--input); }
.auth-account-link {
  border: 1px solid rgba(239, 90, 33, 0.24);
  background: rgba(239, 90, 33, 0.09);
  color: var(--orange);
}
.auth-account-link:hover { background: rgba(239, 90, 33, 0.15); }

.auth-shell {
  min-height: calc(100dvh - 78px);
  display: grid;
  grid-template-columns: minmax(580px, 0.95fr) minmax(430px, 1.05fr);
  direction: rtl;
}
.auth-form-panel {
  position: relative;
  z-index: 2;
  grid-column: 1;
  min-width: 0;
  padding: 24px clamp(34px, 5vw, 82px) 42px;
  background:
    radial-gradient(circle at 100% 0, rgba(26, 163, 154, 0.08), transparent 25%),
    var(--panel);
}
.auth-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 34px;
}
.auth-brand {
  display: flex;
  align-items: center;
  gap: 11px;
  color: var(--ink);
  text-decoration: none;
}
.auth-brand img {
  width: 52px;
  height: 52px;
  object-fit: contain;
  border-radius: 50%;
}
.auth-brand > span {
  display: flex;
  flex-direction: column;
}
.auth-brand strong {
  font-size: 21px;
  font-weight: 900;
  line-height: 1.25;
}
.auth-brand small {
  color: var(--muted);
  font-size: 9px;
  font-weight: 800;
}
.auth-theme {
  width: 50px;
  height: 50px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: var(--card);
  color: var(--ink);
  cursor: pointer;
  box-shadow: 0 8px 22px var(--shadow);
}
.auth-theme span {
  grid-area: 1 / 1;
  font-size: 20px;
  transition: transform 0.3s ease, opacity 0.3s ease;
}
html[data-theme="light"] .auth-theme .moon,
html[data-theme="dark"] .auth-theme .sun {
  opacity: 0;
  transform: scale(0.4) rotate(45deg);
}
.auth-form-wrap {
  width: min(100%, 680px);
  margin: 0 auto;
}
.auth-heading { margin-bottom: 26px; }
.auth-heading > p {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 0 0 8px;
  color: var(--teal);
  font-size: 11px;
  font-weight: 900;
}
.auth-heading > p i {
  width: 18px;
  height: 2px;
  background: var(--orange);
}
.auth-heading h1 {
  margin: 0;
  color: var(--ink);
  font-size: clamp(36px, 3.5vw, 52px);
  font-weight: 900;
  line-height: 1.22;
  letter-spacing: -0.045em;
}
.auth-heading h1 em {
  color: var(--orange);
  font-style: normal;
}
.auth-heading > span {
  display: block;
  margin-top: 10px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}
.register-form { display: grid; gap: 17px; }
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 15px;
}
.auth-field {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.auth-field label {
  color: var(--ink);
  font-size: 12px;
  font-weight: 900;
}
.auth-field > small {
  color: var(--muted);
  font-size: 9px;
  font-weight: 700;
}
.input-shell {
  min-height: 54px;
  display: flex;
  align-items: center;
  gap: 9px;
  overflow: hidden;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: var(--input);
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}
.input-shell:focus-within {
  border-color: rgba(26, 163, 154, 0.65);
  background: var(--card);
  box-shadow: 0 0 0 4px rgba(26, 163, 154, 0.1);
}
.input-shell > span {
  width: 22px;
  flex: 0 0 auto;
  color: var(--teal);
  font-size: 15px;
  text-align: center;
}
.input-shell input,
.input-shell select {
  width: 100%;
  min-width: 0;
  height: 52px;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font-size: 12px;
  font-weight: 800;
}
.input-shell input::placeholder { color: color-mix(in srgb, var(--muted) 70%, transparent); }
.input-shell select {
  cursor: pointer;
  appearance: none;
}
.input-shell select:invalid { color: var(--muted); }
.input-shell select option {
  background: var(--card);
  color: var(--ink);
}
.select-shell {
  position: relative;
  z-index: 1;
  overflow: visible;
}
.select-shell.is-open { z-index: 20; }
.select-shell > select {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}
.select-shell::after { display: none; }

.custom-select {
  position: relative;
  width: 100%;
  min-width: 0;
}
.custom-select-trigger {
  width: 100%;
  min-height: 52px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 12px;
  font-weight: 800;
  text-align: right;
  cursor: pointer;
}
.custom-select-trigger:focus { outline: 0; }
.custom-select-value {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.custom-select-value.is-placeholder { color: var(--muted); font-weight: 700; }
.custom-select-chevron {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 9px;
  background: color-mix(in srgb, var(--teal) 10%, transparent);
  color: var(--teal);
  transition: transform 0.22s ease, background 0.2s ease;
}
.custom-select-chevron svg {
  width: 14px;
  height: 14px;
  display: block;
}
.select-shell.is-open .custom-select-chevron {
  transform: rotate(180deg);
  background: color-mix(in srgb, var(--orange) 14%, transparent);
  color: var(--orange);
}
.select-shell.is-open.input-shell {
  border-color: rgba(26, 163, 154, 0.65);
  background: var(--card);
  box-shadow: 0 0 0 4px rgba(26, 163, 154, 0.1);
}
.custom-select-panel {
  position: absolute;
  z-index: 40;
  top: calc(100% + 8px);
  right: 0;
  left: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--card);
  box-shadow:
    0 18px 40px var(--shadow),
    0 2px 0 color-mix(in srgb, var(--orange) 18%, transparent);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px) scale(0.98);
  transform-origin: top center;
  transition: opacity 0.18s ease, transform 0.18s ease, visibility 0.18s ease;
  pointer-events: none;
}
.select-shell.is-open .custom-select-panel {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}
.custom-select-search {
  position: sticky;
  top: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--input) 88%, var(--card));
}
.custom-select-search span {
  width: auto;
  color: var(--muted);
  font-size: 13px;
}
.custom-select-search input {
  width: 100%;
  height: 36px;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font-size: 12px;
  font-weight: 700;
}
.custom-select-search input::placeholder {
  color: color-mix(in srgb, var(--muted) 75%, transparent);
}
.custom-select-list {
  max-height: min(260px, 42vh);
  overflow: auto;
  padding: 8px;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: color-mix(in srgb, var(--teal) 45%, transparent) transparent;
}
.custom-select-list::-webkit-scrollbar { width: 6px; }
.custom-select-list::-webkit-scrollbar-thumb {
  border-radius: 99px;
  background: color-mix(in srgb, var(--teal) 40%, transparent);
}
.custom-select-option {
  width: 100%;
  min-height: 42px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border: 0;
  border-radius: 11px;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 12px;
  font-weight: 800;
  text-align: right;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}
.custom-select-option:hover,
.custom-select-option.is-active {
  background: color-mix(in srgb, var(--teal) 12%, transparent);
  color: var(--teal);
}
.custom-select-option.is-selected {
  background: linear-gradient(135deg, rgba(239, 90, 33, 0.12), rgba(26, 163, 154, 0.1));
  color: var(--orange);
}
.custom-select-option.is-selected .custom-select-check {
  opacity: 1;
  transform: scale(1);
}
.custom-select-check {
  width: 18px;
  height: 18px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 50%;
  background: color-mix(in srgb, var(--orange) 16%, transparent);
  color: var(--orange);
  font-size: 11px;
  font-weight: 900;
  opacity: 0;
  transform: scale(0.6);
  transition: opacity 0.15s ease, transform 0.15s ease;
}
.custom-select-empty {
  padding: 22px 12px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  text-align: center;
}
.auth-field.has-error .select-shell.is-open.input-shell {
  border-color: #d84545;
  box-shadow: 0 0 0 4px rgba(216, 69, 69, 0.08);
}
.password-shell button {
  width: 32px;
  height: 32px;
  flex: 0 0 auto;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}
.password-shell button:hover { background: rgba(26, 163, 154, 0.1); color: var(--teal); }
.auth-field.has-error .input-shell {
  border-color: #d84545;
  box-shadow: 0 0 0 4px rgba(216, 69, 69, 0.08);
}
.auth-alert {
  margin: 0;
  padding: 12px 14px;
  border: 1px solid rgba(216, 69, 69, 0.22);
  border-radius: 13px;
  background: rgba(216, 69, 69, 0.08);
  color: #c73b3b;
  font-size: 11px;
  font-weight: 800;
}
html[data-theme="dark"] .auth-alert { color: #ffaaaa; }
.auth-alert.success {
  border-color: rgba(26, 163, 154, 0.25);
  background: rgba(26, 163, 154, 0.1);
  color: #16887f;
}
html[data-theme="dark"] .auth-alert.success { color: #8be3da; }
.register-submit {
  min-height: 58px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  border: 0;
  border-radius: 17px;
  background: linear-gradient(135deg, #f36c31, #e94e18);
  color: #fff;
  font-size: 14px;
  font-weight: 900;
  cursor: pointer;
  box-shadow: 0 15px 30px rgba(239, 90, 33, 0.23);
  transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
}
.register-submit:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 20px 35px rgba(239, 90, 33, 0.3);
}
.register-submit:disabled { opacity: 0.58; cursor: wait; }
.register-submit b { font-size: 19px; }
.auth-login-line {
  margin: 20px 0 0;
  color: var(--muted);
  font-size: 11px;
  text-align: center;
}
.auth-login-line a {
  color: var(--teal);
  font-weight: 900;
  text-decoration: none;
}
.login-wrap {
  max-width: 570px;
  padding-top: clamp(22px, 7vh, 90px);
}
.login-form { margin-top: 20px; }
.forgot-password-btn {
  display: block;
  width: 100%;
  margin: 0 0 12px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--teal);
  font-family: inherit;
  font-size: 12px;
  font-weight: 800;
  text-align: center;
  cursor: pointer;
}
.forgot-password-btn:hover {
  text-decoration: underline;
}

.auth-visual {
  position: sticky;
  top: 78px;
  grid-column: 2;
  height: calc(100dvh - 78px);
  min-height: 680px;
  overflow: hidden;
  direction: rtl;
  background: #09192a;
}
.auth-visual > img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  object-position: center;
}
html[data-theme="light"] .auth-image-dark,
html[data-theme="dark"] .auth-image-light { display: none; }
.visual-overlay {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(4, 15, 28, 0.08) 32%, rgba(4, 15, 28, 0.9) 100%),
    linear-gradient(90deg, rgba(4, 15, 28, 0.08), rgba(4, 15, 28, 0.28));
}
html[data-theme="light"] .visual-overlay {
  background:
    linear-gradient(180deg, rgba(250, 245, 235, 0.02) 42%, rgba(10, 31, 48, 0.86) 100%),
    linear-gradient(90deg, transparent, rgba(12, 36, 53, 0.08));
}
.visual-copy {
  position: absolute;
  right: clamp(30px, 5vw, 72px);
  bottom: 100px;
  left: clamp(30px, 5vw, 72px);
  color: #fff;
}
.visual-copy > span {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #8be3da;
  font-size: 11px;
  font-weight: 900;
}
.visual-copy > span i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #ff7b42;
  box-shadow: 0 0 0 6px rgba(255, 123, 66, 0.14);
}
.visual-copy h2 {
  margin: 9px 0 8px;
  font-size: clamp(31px, 3.2vw, 50px);
  font-weight: 900;
  line-height: 1.25;
  letter-spacing: -0.04em;
}
.visual-copy p {
  max-width: 590px;
  margin: 0;
  color: #d8e3ec;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.85;
}
.visual-proof {
  position: absolute;
  right: clamp(30px, 5vw, 72px);
  bottom: 34px;
  left: clamp(30px, 5vw, 72px);
  display: flex;
  align-items: center;
  gap: 13px;
  color: #fff;
  font-size: 10px;
  font-weight: 900;
}
.visual-proof i {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #ff7b42;
}

.welcome-modal {
  position: fixed;
  z-index: 50;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(4, 14, 25, 0.68);
  backdrop-filter: blur(10px);
}
.welcome-modal[hidden] { display: none; }
.welcome-card {
  width: min(100%, 430px);
  padding: 38px 30px;
  border: 1px solid var(--line);
  border-radius: 28px;
  background: var(--card);
  color: var(--ink);
  text-align: center;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.25);
  animation: welcome-in 0.42s ease both;
}
.welcome-mark {
  width: 66px;
  height: 66px;
  display: grid;
  place-items: center;
  margin: 0 auto 14px;
  border-radius: 50%;
  background: rgba(26, 163, 154, 0.12);
  color: var(--teal);
  font-size: 29px;
  font-weight: 900;
  box-shadow: 0 0 0 9px rgba(26, 163, 154, 0.06);
}
.welcome-card > p { margin: 0; color: var(--orange); font-size: 11px; font-weight: 900; }
.welcome-card h2 { margin: 6px 0; font-size: 27px; font-weight: 900; }
.welcome-card > span { display: block; color: var(--muted); font-size: 13px; }
.welcome-card > small { display: block; margin-top: 19px; color: var(--teal); font-size: 10px; }

.auth-site-footer {
  position: relative;
  border-top: 1px solid var(--line);
  background:
    radial-gradient(circle at 85% 0, rgba(26, 163, 154, 0.08), transparent 28%),
    color-mix(in srgb, var(--card) 76%, var(--bg));
  color: var(--ink);
}
.auth-footer-main,
.auth-footer-bottom {
  width: min(1260px, calc(100% - 40px));
  margin: 0 auto;
}
.auth-footer-main {
  min-height: 148px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 30px;
  padding: 28px 0;
}
.auth-footer-brand {
  display: flex;
  max-width: 650px;
  align-items: center;
  gap: 15px;
  color: var(--ink);
  text-decoration: none;
}
.auth-footer-brand > span:first-child {
  width: 68px;
  height: 68px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 21px;
  background: var(--card);
  box-shadow: 0 10px 25px var(--shadow);
}
.auth-footer-brand img {
  width: 59px;
  height: 59px;
  object-fit: contain;
}
.auth-footer-brand > span:last-child { display: flex; flex-direction: column; }
.auth-footer-brand strong { font-size: 24px; font-weight: 900; }
.auth-footer-brand small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.8;
}
.auth-footer-contact {
  min-width: 220px;
  display: flex;
  flex-direction: column;
  padding: 13px 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--card);
  color: var(--ink);
  text-decoration: none;
}
.auth-footer-contact small { color: var(--muted); font-size: 9px; font-weight: 800; }
.auth-footer-contact strong { margin-top: 3px; color: var(--teal); font-size: 14px; font-weight: 900; }
.auth-footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 17px 0 22px;
  border-top: 1px solid var(--line);
}
.auth-footer-bottom p {
  margin: 0;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
}
.auth-footer-bottom strong { color: var(--ink); font-weight: 900; }

@keyframes welcome-in {
  from { opacity: 0; transform: translateY(18px) scale(0.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@media (max-width: 1100px) {
  .auth-shell { grid-template-columns: minmax(540px, 1.08fr) minmax(380px, 0.92fr); }
  .auth-form-panel { padding-inline: 32px; }
}

@media (max-width: 900px) {
  .auth-shell {
    display: flex;
    flex-direction: column;
  }
  .auth-visual {
    position: relative;
    top: auto;
    order: -1;
    width: 100%;
    height: 360px;
    min-height: 0;
  }
  .auth-form-panel { padding: 20px 22px 42px; }
  .auth-top { margin-bottom: 28px; }
  .visual-copy { bottom: 68px; }
  .visual-proof { bottom: 22px; }
}

@media (max-width: 600px) {
  .auth-site-header-inner {
    width: calc(100% - 24px);
    height: 68px;
  }
  .auth-site-header .auth-brand img { width: 45px; height: 45px; }
  .auth-site-header .auth-brand strong { font-size: 18px; }
  .auth-site-header .auth-brand small,
  .auth-home-link { display: none; }
  .auth-header-actions { gap: 7px; }
  .auth-account-link {
    min-height: 40px;
    max-width: 145px;
    padding: 8px 10px;
    font-size: 9px;
    text-align: center;
  }
  .auth-site-header .auth-theme {
    width: 42px;
    height: 42px;
    border-radius: 13px;
  }
  .auth-visual { height: 300px; }
  .visual-copy { right: 20px; bottom: 54px; left: 20px; }
  .visual-copy h2 { font-size: 30px; }
  .visual-copy p { display: none; }
  .visual-proof { right: 20px; bottom: 17px; left: 20px; gap: 8px; font-size: 8px; }
  .auth-form-panel { padding: 16px 14px 34px; }
  .auth-brand small { display: none; }
  .auth-top { margin-bottom: 24px; }
  .auth-heading h1 { font-size: 38px; }
  .auth-heading > span { font-size: 12px; line-height: 1.8; }
  .form-grid { grid-template-columns: 1fr; gap: 14px; }
  .register-form { gap: 14px; }
  .auth-footer-main,
  .auth-footer-bottom { width: calc(100% - 28px); }
  .auth-footer-main {
    min-height: 0;
    align-items: stretch;
    flex-direction: column;
  }
  .auth-footer-brand { align-items: flex-start; }
  .auth-footer-contact { min-width: 0; }
  .auth-footer-bottom {
    align-items: flex-start;
    flex-direction: column;
    gap: 7px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
