:root {
  color-scheme: light;
  --bg: #f5f7fb;
  --surface: #ffffff;
  --surface-soft: #f8fafc;
  --ink: #172033;
  --muted: #657084;
  --line: #dfe5ef;
  --primary: #4338ca;
  --primary-dark: #251f8f;
  --primary-soft: #eef0ff;
  --accent: #14b8a6;
  --success: #12805c;
  --danger: #c2413a;
  --warning: #a16207;
  --shadow: 0 24px 70px rgba(20, 28, 46, 0.12);
  --radius-lg: 24px;
  --radius-md: 16px;
  --radius-sm: 10px;
  font-family: "Cairo", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--bg);
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  font-family: "Cairo", system-ui, sans-serif;
  background:
    radial-gradient(circle at top right, rgba(67, 56, 202, 0.11), transparent 30rem),
    linear-gradient(135deg, #f8fafc 0%, #eef2ff 55%, #f4fbf9 100%);
}

button,
input {
  font: inherit;
}

svg {
  display: block;
  width: 1.15rem;
  height: 1.15rem;
  fill: currentColor;
}

.login-shell {
  display: grid;
  grid-template-columns: minmax(0, 1.04fr) minmax(420px, 0.96fr);
  min-height: 100vh;
  overflow: hidden;
}

.brand-panel {
  position: relative;
  display: flex;
  align-items: center;
  padding: clamp(2rem, 5vw, 5rem);
  background:
    linear-gradient(145deg, rgba(7, 12, 35, 0.95), rgba(38, 32, 121, 0.92)),
    linear-gradient(180deg, #0f172a, #1e1b4b);
  color: #fff;
  isolation: isolate;
}

.brand-panel::before {
  position: absolute;
  inset: 9% -16% auto auto;
  width: min(38vw, 32rem);
  aspect-ratio: 1;
  content: "";
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  background: radial-gradient(circle, rgba(139, 122, 255, 0.18), transparent 62%);
  z-index: -1;
}

.brand-panel::after {
  position: absolute;
  inset: auto auto -9rem -8rem;
  width: min(42vw, 34rem);
  aspect-ratio: 1;
  content: "";
  border-radius: 999px;
  background: radial-gradient(circle, rgba(20, 184, 166, 0.18), transparent 68%);
  z-index: -1;
}

.brand-panel__content {
  width: min(100%, 43rem);
}

.brand-lockup {
  display: inline-grid;
  gap: 0.35rem;
  color: inherit;
  text-decoration: none;
}

.brand-logo {
  display: block;
  width: min(17rem, 54vw);
  height: 6rem;
  object-fit: contain;
  object-position: center;
}

.auth-logo {
  display: block;
  width: 10.75rem;
  height: 3.75rem;
  object-fit: contain;
  object-position: center right;
  margin-bottom: 1.25rem;
}

.brand-copy {
  margin-top: clamp(3rem, 8vh, 5.5rem);
}

.eyebrow {
  margin: 0 0 1rem;
  color: #b9f5ef;
  font-size: 0.95rem;
  font-weight: 800;
}

.brand-copy h1 {
  max-width: 18ch;
  margin: 0;
  font-size: clamp(2rem, 3.8vw, 3.65rem);
  font-weight: 800;
  line-height: 1.22;
}

.brand-copy p:not(.eyebrow) {
  max-width: 32rem;
  margin: 1.25rem 0 0;
  color: rgba(255, 255, 255, 0.78);
  font-size: 1rem;
  font-weight: 500;
  line-height: 1.9;
}

.auth-panel {
  display: grid;
  align-items: center;
  padding: clamp(1.25rem, 4vw, 4rem);
}

.auth-card {
  width: min(100%, 32rem);
  margin-inline: auto;
  padding: clamp(1.5rem, 4vw, 2.5rem);
  border: 1px solid rgba(223, 229, 239, 0.85);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.88);
  box-shadow: var(--shadow);
  backdrop-filter: blur(22px);
}

.auth-card__header {
  margin-bottom: 2rem;
}

.auth-badge {
  display: inline-flex;
  align-items: center;
  min-height: 2rem;
  padding: 0.35rem 0.8rem;
  border: 1px solid #dce2ff;
  border-radius: 999px;
  color: var(--primary);
  background: var(--primary-soft);
  font-size: 0.78rem;
  font-weight: 900;
}

.auth-card h2 {
  margin: 1rem 0 0.5rem;
  color: var(--ink);
  font-size: clamp(1.7rem, 3vw, 2.35rem);
  font-weight: 900;
}

.auth-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.98rem;
  font-weight: 500;
  line-height: 1.8;
}

.login-form {
  display: grid;
  gap: 1.15rem;
}

.field-group {
  display: grid;
  gap: 0.5rem;
}

.field-group label,
.field-label-row {
  color: #26324a;
  font-size: 0.92rem;
  font-weight: 800;
}

.field-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.caps-warning {
  color: var(--warning);
  font-size: 0.78rem;
  font-weight: 800;
}

.input-shell {
  position: relative;
  display: flex;
  align-items: center;
  min-height: 3.55rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
  transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.input-shell:focus-within {
  border-color: rgba(67, 56, 202, 0.62);
  box-shadow: 0 0 0 4px rgba(67, 56, 202, 0.12);
}

.input-icon {
  display: grid;
  width: 3.25rem;
  flex: 0 0 3.25rem;
  place-items: center;
  color: #7a86a1;
}

.input-shell input {
  width: 100%;
  min-width: 0;
  height: 3.45rem;
  border: 0;
  outline: 0;
  color: var(--ink);
  background: transparent;
  font-size: 1rem;
  font-weight: 700;
}

.input-shell input::placeholder {
  color: #9aa5b8;
  font-weight: 500;
}

.field-group small {
  color: #7a8497;
  font-size: 0.8rem;
  font-weight: 600;
}

.ghost-icon-button {
  display: grid;
  width: 2.75rem;
  height: 2.75rem;
  margin-inline-end: 0.4rem;
  padding: 0;
  place-items: center;
  border: 0;
  border-radius: var(--radius-sm);
  color: #657084;
  background: transparent;
  cursor: pointer;
}

.ghost-icon-button:hover,
.ghost-icon-button:focus-visible {
  color: var(--primary);
  background: var(--primary-soft);
  outline: 0;
}

.form-message {
  min-height: 3rem;
  padding: 0.8rem 1rem;
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  font-weight: 800;
  line-height: 1.55;
}

.form-message.is-error {
  border: 1px solid rgba(194, 65, 58, 0.2);
  color: var(--danger);
  background: #fff4f3;
}

.form-message.is-success {
  border: 1px solid rgba(18, 128, 92, 0.2);
  color: var(--success);
  background: #eefbf6;
}

.primary-button {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 3.65rem;
  margin-top: 0.35rem;
  padding: 0 1.25rem;
  border: 0;
  border-radius: var(--radius-md);
  color: #fff;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  box-shadow: 0 16px 34px rgba(67, 56, 202, 0.25);
  cursor: pointer;
  font-size: 1rem;
  font-weight: 900;
  transition: transform 160ms ease, box-shadow 160ms ease, opacity 160ms ease;
}

.primary-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 20px 40px rgba(67, 56, 202, 0.28);
}

.primary-button:focus-visible {
  outline: 4px solid rgba(67, 56, 202, 0.2);
  outline-offset: 3px;
}

.primary-button:disabled {
  cursor: wait;
  opacity: 0.78;
  transform: none;
}

.button-loader {
  display: none;
  width: 1.25rem;
  height: 1.25rem;
  margin-inline-start: 0.7rem;
  border: 2px solid rgba(255, 255, 255, 0.42);
  border-top-color: #fff;
  border-radius: 999px;
  animation: spin 800ms linear infinite;
}

.primary-button.is-loading .button-loader {
  display: inline-block;
}

.auth-card__footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.7rem;
  margin-top: 1.6rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--line);
  color: #7a8497;
  font-size: 0.78rem;
  font-weight: 800;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@media (max-width: 980px) {
  .login-shell {
    grid-template-columns: 1fr;
  }

  .brand-panel {
    min-height: 44vh;
  }

  .brand-copy {
    margin-top: 3rem;
  }

  .brand-copy h1 {
    max-width: 22ch;
  }
}

@media (max-width: 680px) {
  body {
    background: linear-gradient(180deg, #f8fafc 0%, #eef2ff 100%);
  }

  .brand-panel {
    min-height: auto;
    padding: 1.5rem;
  }

  .brand-logo {
    width: 12.5rem;
    height: 4.75rem;
  }

  .brand-copy h1 {
    font-size: clamp(1.75rem, 8vw, 2.35rem);
  }

  .brand-copy {
    margin-top: 2.2rem;
  }

  .brand-copy p:not(.eyebrow) {
    font-size: 0.96rem;
  }

  .auth-panel {
    padding: 1rem;
  }

  .auth-card {
    padding: 1.25rem;
    border-radius: 18px;
  }
}
