:root {
  --ink: #111820;
  --muted: #64707e;
  --line: #d8dee5;
  --surface: #ffffff;
  --canvas: #eef1f4;
  --yellow: #f1bd3d;
  --green: #17a673;
  --danger: #b42318;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { min-height: 100%; background: var(--canvas); }
body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background: var(--canvas);
  font-family: "SF Arabic", "Noto Sans Arabic", Tahoma, Arial, sans-serif;
  letter-spacing: 0;
}
button, input { font: inherit; letter-spacing: 0; }
a { color: inherit; }

.auth-shell {
  width: min(1080px, calc(100% - 40px));
  min-height: min(720px, calc(100vh - 48px));
  margin: 24px auto;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(380px, .95fr);
  overflow: hidden;
  border: 1px solid #cfd6de;
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 22px 60px rgba(17, 24, 32, .14);
}

.brand-panel {
  min-height: 100%;
  padding: 54px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 28px;
  color: #f8fafc;
  background: #131a22;
}
.brand-mark {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  border-radius: 7px;
  color: #151a20;
  background: var(--yellow);
  font-size: 24px;
  font-weight: 900;
}
.eyebrow {
  margin: 0 0 10px;
  color: var(--yellow);
  font-size: 13px;
  font-weight: 900;
}
.brand-panel h1 {
  max-width: 540px;
  margin: 0;
  font-size: clamp(32px, 4vw, 48px);
  line-height: 1.35;
}
.brand-panel > div > p:last-child {
  max-width: 520px;
  margin: 16px 0 0;
  color: #b7c0ca;
  font-size: 16px;
  line-height: 1.9;
}
.system-state {
  width: min(390px, 100%);
  display: grid;
  grid-template-columns: 12px 1fr;
  gap: 12px;
  align-items: center;
  padding: 15px 16px;
  border: 1px solid #35404b;
  border-radius: 6px;
  background: #1d252e;
}
.state-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 4px rgba(23, 166, 115, .13);
}
.system-state strong, .system-state small { display: block; }
.system-state strong { font-size: 13px; }
.system-state small { margin-top: 3px; color: #aeb8c4; line-height: 1.6; }

.form-panel {
  padding: 48px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.wordmark {
  display: none;
  color: var(--ink);
  font-weight: 900;
  text-decoration: none;
}
.form-heading { margin-bottom: 24px; }
.form-heading > p:first-of-type {
  margin: 0 0 7px;
  color: var(--green);
  font-size: 12px;
  font-weight: 900;
}
.form-heading h2 { margin: 0; font-size: 30px; }
.form-heading > p:last-child { margin: 9px 0 0; color: var(--muted); line-height: 1.7; }

.auth-form { display: grid; gap: 16px; }
.auth-form label { display: grid; gap: 7px; font-size: 13px; font-weight: 800; }
.auth-form label small { color: var(--muted); font-size: 10px; font-weight: 500; line-height: 1.6; }
.auth-form input {
  width: 100%;
  min-height: 48px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 5px;
  color: var(--ink);
  background: #fbfcfd;
  outline: 0;
}
.auth-form input:focus { border-color: #5289d8; box-shadow: 0 0 0 3px rgba(82, 137, 216, .12); }
.form-row { display: flex; justify-content: flex-start; }
.form-row a, .switch-copy a { color: #265ca8; font-weight: 800; text-decoration: none; }
.form-row a:hover, .switch-copy a:hover { text-decoration: underline; }
.primary-button {
  min-height: 49px;
  border: 0;
  border-radius: 5px;
  color: #111820;
  background: var(--yellow);
  font-weight: 900;
  cursor: pointer;
}
.primary-button:hover { background: #e5ad25; }
.primary-button:disabled { color: #7a828c; background: #e4e7eb; cursor: not-allowed; }
.switch-copy, .service-note {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.8;
  text-align: center;
}
.service-note { padding: 10px; border: 1px solid #e8d49b; border-radius: 5px; background: #fff9e8; }

.message {
  margin-bottom: 18px;
  padding: 12px 14px;
  border: 1px solid #b8ddd2;
  border-radius: 5px;
  color: #176247;
  background: #eff9f5;
  font-size: 13px;
  line-height: 1.7;
}
.message.error { border-color: #efc1bc; color: var(--danger); background: #fff3f1; }
.verification-panel { padding: 30px 0; text-align: center; }
.verification-panel strong { display: block; margin-top: 15px; }
.verification-panel p { color: var(--muted); line-height: 1.8; }
.loader {
  width: 36px;
  height: 36px;
  margin: auto;
  border: 4px solid #dde3e9;
  border-top-color: var(--green);
  border-radius: 50%;
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

footer {
  margin-top: 32px;
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  color: #7b8490;
  font-size: 9px;
}
footer span { padding: 5px 7px; border: 1px solid var(--line); border-radius: 4px; }

@media (max-width: 780px) {
  .auth-shell { width: 100%; min-height: 100vh; margin: 0; grid-template-columns: 1fr; border: 0; border-radius: 0; }
  .brand-panel { display: none; }
  .form-panel { min-height: 100vh; padding: 28px 22px; }
  .wordmark { display: inline-block; margin-bottom: 34px; }
  .form-heading h2 { font-size: 27px; }
}
