:root {
  --brand: #cf1b1c;
  --brand-hover: #880404;
  --bg: #f6f7f9;
  --card: #fff;
  --text: #0f172a;
  --muted: #6b7280;
  --border: #e5e7eb;
  --focus: rgba(207, 27, 28, 0.14);
  --radius: 20px;
}

/* page shell */
html,
body {
  height: 100%;
}
body {
  margin: 0;
  font-family:
    ui-sans-serif,
    system-ui,
    -apple-system,
    Segoe UI,
    Roboto,
    Ubuntu,
    Cantarell,
    Noto Sans,
    Helvetica Neue,
    Arial;
  color: var(--text);
  background: var(--bg);
  display: flex;
  flex-direction: column;
}

.auth-shell {
  min-height: calc(100vh - 48px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(16px, 4vw, 32px);
}

/* card */
.auth-card {
  width: min(960px, 96vw);
  min-height: 420px;
  background: var(--card);
  border-radius: var(--radius);
  box-shadow:
    0 10px 20px rgba(0, 0, 0, 0.06),
    0 4px 8px rgba(0, 0, 0, 0.04);
  display: grid;
  grid-template-columns: 1fr 1fr;
  overflow: hidden;
}

/* brand side */
.brand-panel {
  background: var(--brand);
  display: grid;
  place-items: center;
  padding: clamp(24px, 5vw, 48px);
}
.brand-logo {
  width: min(300px, 65%);
  max-width: 320px;
  height: auto;
  filter: brightness(0) invert(1);
  user-select: none;
  -webkit-user-drag: none;
}

/* form side */
.form-panel {
  display: grid;
  place-items: center;
  padding: clamp(20px, 4vw, 48px);
  background: var(--card);
}
.form-wrap {
  width: min(420px, 90%);
}

.title {
  font-size: clamp(24px, 3vw, 34px);
  line-height: 1.2;
  font-weight: 700;
  margin: 0 0 6px;
}
.subtitle {
  margin: 0 0 22px;
  color: var(--muted);
  font-size: 14px;
}

/* input with icon */
.input-with-icon {
  display: flex;
  position: relative;
  margin-top: 8px;
}
.input-with-icon .icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  opacity: 0.65;
  font-size: 18px;
  pointer-events: none;
}
.control {
  width: 100%;
  height: 56px;
  padding: 0 14px 0 44px;
  font-size: 16px;
  color: var(--text);
  background: #f7f7f7;
  border: 1px solid #eee;
  border-radius: 12px;
  outline: none;
  transition:
    box-shadow 0.2s,
    border-color 0.2s,
    background 0.2s;
}
.control:focus {
  background: #fff;
  border-color: var(--brand);
  box-shadow: 0 0 0 0.2rem var(--focus);
}

.row-end-hint {
  display: flex;
  justify-content: flex-end;
  margin: 10px 0;
  font-size: 12px;
  color: var(--muted);
}

/* buttons */
.btn {
  display: inline-grid;
  place-items: center;
  width: 100%;
  height: 54px;
  border-radius: 12px;
  border: 1px solid transparent;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition:
    filter 0.15s,
    opacity 0.15s,
    transform 0.02s;
  user-select: none;
  position: relative;
  margin-top: 10px;
}
.btn:active {
  transform: translateY(1px);
}
.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}
.btn-brand {
  background: var(--brand);
  color: #fff;
  border-color: var(--brand);
}
.btn-brand:hover {
  background: var(--brand-hover);
  color: #fff;
}
.btn-ghost {
  background: transparent;
  color: var(--text);
  border-color: var(--border);
  height: 40px;
  width: auto;
  padding: 0 12px;
  font-weight: 500;
}
.link {
  background: none;
  border: none;
  color: var(--brand);
  font: inherit;
  padding: 0;
  cursor: pointer;
}
.link:disabled {
  color: #c1c1c1;
  cursor: not-allowed;
}

/* button loading */
.btn.is-loading {
  pointer-events: none;
  /* opacity: 0.85; */
}
.btn.is-loading .btn-label {
  opacity: 0;
}
.btn .spinner {
  display: none;
  position: absolute;
  inline-size: 18px;
  block-size: 18px;
  border: 2px solid rgba(255, 255, 255, 0.45);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
.btn.is-loading .spinner {
  display: inline-block;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.link.is-loading {
  pointer-events: none;
  opacity: 0.8;
}
.link .spinner {
  display: none;
  inline-size: 14px;
  block-size: 14px;
  border: 2px solid rgba(207, 27, 28, 0.35);
  border-top-color: var(--brand);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  vertical-align: -2px;
  margin-left: 6px;
}
.link.is-loading .spinner {
  display: inline-block;
}

/* alerts */
.alert {
  margin-top: 14px;
  padding: 12px 14px;
  border-radius: 10px;
  font-size: 14px;
  border: 1px solid transparent;
}
.alert-success {
  background: #ecfdf5;
  color: #065f46;
  border-color: #a7f3d0;
}
.alert-warning {
  background: #fffbeb;
  color: #92400e;
  border-color: #fde68a;
}
.alert-danger {
  background: #fef2f2;
  color: #991b1b;
  border-color: #fecaca;
}
.hidden {
  display: none !important;
}

/* otp */
.otp-inputs {
  display: grid;
  grid-auto-flow: column;
  gap: 10px;
  justify-content: center;
  margin: 10px 0 8px;
}
.otp {
  width: 52px;
  height: 58px;
  text-align: center;
  font-size: 20px;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  background: #fff;
  outline: none;
  transition:
    box-shadow 0.2s,
    border-color 0.2s;
}
.otp:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 0.2rem var(--focus);
}

.row-between {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 6px;
}

/* footer */
.footer {
  height: 48px;
  display: grid;
  place-items: center;
  padding: 0 12px;
  font-size: 14px;
  color: #8b8f97;
  text-align: center;
}

/* responsive */
@media (max-width: 900px) {
  .auth-card {
    grid-template-columns: 1fr;
  }
  .brand-panel {
    min-height: 200px;
  }
  .brand-logo {
    width: 180px;
  }
  .form-wrap {
    width: min(520px, 92%);
  }
}

.auth-shell.rtl .input-with-icon {
  flex-direction: row-reverse;
}
.auth-shell.rtl .icon {
  margin-inline-start: 0.5rem;
  margin-inline-end: 0;
}
.auth-shell.ltr .icon {
  margin-inline-start: 0;
  margin-inline-end: 0.5rem;
}
