:root {
  --page-bg: #f2f4fb;
  --panel-tint: #f4f6ff;
  --primary: #4f46e5;
  --primary-dark: #3730a3;
  --primary-soft: #eef0ff;
  --growth: #10b981;
  --text: #171b2f;
  --muted: #687086;
  --soft: #9aa4b8;
  --field-bg: #f0f4ff;
  --field-border: #d8dded;
  --shadow: 0 32px 90px rgba(31, 41, 85, 0.16);
  --shell-max-width: 1060px;
  --page-gutter: clamp(20px, 4.5vw, 56px);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: var(--page-gutter);
  font-family: Manrope, "Segoe UI", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 19% 18%, rgba(202, 209, 255, 0.92), transparent 29%),
    radial-gradient(circle at 84% 16%, rgba(187, 247, 208, 0.6), transparent 27%),
    linear-gradient(180deg, #f9fbff 0%, var(--page-bg) 100%);
}

.login-shell {
  width: min(var(--shell-max-width), calc(100vw - (var(--page-gutter) * 2)));
  min-height: clamp(560px, calc(100dvh - (var(--page-gutter) * 2)), 680px);
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  overflow: hidden;
  border-radius: 28px;
  background: #fff;
  box-shadow: var(--shadow);
}

.brand-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 48px 40px;
  background: linear-gradient(160deg, #f7f8ff 0%, var(--panel-tint) 55%, #eef2ff 100%);
}
.illustration-wrap { width: 100%; display: flex; justify-content: center; margin-bottom: 28px; }
.login-illu { max-width: 380px; max-height: 300px; width: 100%; object-fit: contain; }
.brand-title { margin: 0; font-size: 1.75rem; font-weight: 800; letter-spacing: -0.02em; }
.brand-copy { margin: 10px 0 0; font-size: .92rem; color: var(--muted); max-width: 34ch; line-height: 1.55; }

.form-panel { display: flex; align-items: center; justify-content: center; padding: 44px 48px; overflow-y: auto; }
.form-inner { width: 100%; max-width: 380px; }

.form-brand { display: flex; align-items: center; gap: 14px; margin-bottom: 28px; text-decoration: none; color: inherit; }
.logo-well { width: 48px; height: 48px; border-radius: 14px; background: var(--primary-soft); border: 1px solid #e0e7ff; display: grid; place-items: center; box-shadow: 0 8px 20px -10px rgba(79, 70, 229, .45); flex-shrink: 0; }
.brand-name { display: block; font-size: 1.45rem; font-weight: 800; letter-spacing: -0.01em; }
.brand-sub { display: block; font-size: .88rem; color: var(--muted); margin-top: 2px; }

label { display: block; font-size: .8rem; font-weight: 600; color: #334155; margin: 16px 0 6px; }
.label-row { display: flex; justify-content: space-between; align-items: center; margin-top: 16px; }
.label-row label { margin: 0 0 6px; }
.forgot-link { font-size: .8rem; font-weight: 600; color: var(--primary); text-decoration: none; margin-bottom: 6px; }
.forgot-link:hover { text-decoration: underline; }

.field {
  width: 100%;
  padding: 13px 14px;
  border-radius: 12px;
  border: 1px solid var(--field-border);
  background: var(--field-bg);
  font: inherit;
  font-size: .92rem;
  color: var(--text);
  transition: border-color .15s, box-shadow .15s, background .15s;
}
.field:focus { outline: none; background: #fff; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.16); }
.row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.row-2 label { margin-top: 16px; }

.password-wrap { position: relative; }
.password-wrap .field { padding-right: 46px; }
.toggle-pass { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); border: 0; background: transparent; color: var(--soft); font-size: 1.1rem; padding: 6px; cursor: pointer; border-radius: 8px; }
.toggle-pass:hover { color: var(--primary); }

.btn-signin {
  width: 100%;
  margin-top: 22px;
  border: 0;
  border-radius: 12px;
  padding: 14px 16px;
  background: var(--primary);
  color: #fff;
  font: inherit;
  font-weight: 700;
  font-size: .95rem;
  cursor: pointer;
  box-shadow: 0 14px 28px -14px rgba(79, 70, 229, .7);
  transition: background .15s;
}
.btn-signin:hover { background: var(--primary-dark); }

.alert { display: flex; gap: 10px; align-items: flex-start; border-radius: 12px; padding: 12px 14px; font-size: .85rem; margin-bottom: 14px; border: 1px solid; }
.alert i { font-size: 1.05rem; line-height: 1.2; }
.alert-error { background: #fef2f2; color: #b91c1c; border-color: #fecaca; }
.alert-success { background: #ecfdf5; color: #047857; border-color: #a7f3d0; }
.alert-warning, .alert-info { background: #eef2ff; color: #3730a3; border-color: #c7d2fe; }

.switch-copy { text-align: center; font-size: .86rem; color: var(--muted); margin-top: 20px; }
.switch-copy a { color: var(--primary); font-weight: 700; text-decoration: none; }
.switch-copy a:hover { text-decoration: underline; }
.checkbox { display: flex; gap: 10px; align-items: flex-start; font-size: .8rem; color: var(--muted); margin-top: 16px; font-weight: 500; }
.checkbox input { margin-top: 2px; accent-color: var(--primary); }
.footer-copy { text-align: center; font-size: .75rem; color: var(--soft); margin-top: 28px; }

@media (max-width: 860px) {
  .login-shell { grid-template-columns: 1fr; min-height: auto; }
  .brand-panel { display: none; }
  .form-panel { padding: 36px 24px; }
}
