:root {
  --primary: #4f46e5;
  --primary-dark: #312e81;
  --violet: #7c3aed;
  --ink: #172033;
  --muted: #667085;
  --line: #dbe1ea;
  --surface: #ffffff;
  --danger: #dc2626;
}

* { box-sizing: border-box; }
html, body { min-height: 100%; margin: 0; }
body {
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: #f5f7fb;
  -webkit-font-smoothing: antialiased;
}

button, input { font: inherit; }
svg { display: block; }

.login-page {
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  grid-template-columns: minmax(480px, 1.08fr) minmax(480px, .92fr);
  overflow: hidden;
}

.brand-panel {
  position: relative;
  isolation: isolate;
  min-height: 100vh;
  min-height: 100dvh;
  overflow: hidden;
  color: #fff;
  background:
    radial-gradient(circle at 12% 15%, rgba(129, 140, 248, .36), transparent 30%),
    linear-gradient(145deg, #15134d 0%, #272174 45%, #4c24a8 100%);
}

.brand-panel::after {
  content: "";
  position: absolute;
  right: -10%;
  bottom: -18%;
  width: 520px;
  height: 520px;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 50%;
  box-shadow: 0 0 0 70px rgba(255,255,255,.035), 0 0 0 150px rgba(255,255,255,.025);
  z-index: -1;
}

.brand-bg, .grid-lines { position: absolute; inset: 0; z-index: -1; }
.grid-lines {
  opacity: .16;
  background-image:
    linear-gradient(rgba(255,255,255,.12) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.12) 1px, transparent 1px);
  background-size: 58px 58px;
  mask-image: linear-gradient(to bottom, #000, transparent 82%);
}
.orb { position: absolute; border-radius: 50%; filter: blur(2px); }
.orb-one { width: 260px; height: 260px; right: 8%; top: 8%; background: rgba(139,92,246,.2); }
.orb-two { width: 180px; height: 180px; left: -70px; bottom: 16%; background: rgba(59,130,246,.18); }

.brand-content {
  width: min(690px, 100%);
  min-height: 100%;
  margin: auto;
  padding: clamp(34px, 5vh, 64px) clamp(38px, 6vw, 88px) 32px;
  display: flex;
  flex-direction: column;
}

.company-brand, .mobile-brand {
  display: flex;
  align-items: center;
  gap: 13px;
}
.brand-mark {
  width: 48px;
  height: 48px;
  padding: 8px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255,255,255,.2);
  border-radius: 14px;
  color: #fff;
  background: rgba(255,255,255,.12);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.18);
}
.brand-mark svg { width: 100%; fill: currentColor; }
.brand-mark .mark-accent { fill: #8be9ff; }
.company-brand strong, .mobile-brand strong { display: block; font-size: 15px; letter-spacing: .09em; }
.company-brand small, .mobile-brand small { display: block; margin-top: 3px; color: rgba(255,255,255,.7); font-size: 11px; letter-spacing: .045em; }

.hero-copy { margin: auto 0 46px; }
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 18px;
  color: #d9dcff;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
}
.eyebrow i, .system-online i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #5eead4;
  box-shadow: 0 0 0 5px rgba(94,234,212,.12);
}
.hero-copy h1 {
  margin: 0;
  font-size: clamp(42px, 4.25vw, 66px);
  line-height: 1.03;
  letter-spacing: -.05em;
}
.hero-copy h1 span {
  color: transparent;
  background: linear-gradient(90deg, #a5b4fc, #67e8f9);
  -webkit-background-clip: text;
  background-clip: text;
}
.hero-copy p {
  max-width: 560px;
  margin: 23px 0 0;
  color: rgba(255,255,255,.72);
  font-size: clamp(14px, 1.2vw, 17px);
  line-height: 1.8;
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: clamp(28px, 5vh, 54px);
}
.feature-card {
  min-height: 88px;
  padding: 17px;
  display: flex;
  align-items: center;
  gap: 13px;
  border: 1px solid rgba(255,255,255,.13);
  border-radius: 16px;
  background: rgba(255,255,255,.075);
  backdrop-filter: blur(12px);
  transition: transform .25s ease, background .25s ease, border-color .25s ease;
}
.feature-card:hover { transform: translateY(-3px); background: rgba(255,255,255,.12); border-color: rgba(255,255,255,.25); }
.feature-icon {
  flex: 0 0 42px;
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  color: #c7d2fe;
  background: rgba(129,140,248,.17);
}
.feature-icon svg, .secure-badge svg, .input-icon svg, .password-toggle svg,
.button-arrow svg, .privacy-note svg, .alert-icon svg {
  width: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.feature-card strong { display: block; margin-bottom: 5px; font-size: 13px; }
.feature-card small { display: block; color: rgba(255,255,255,.62); font-size: 10.5px; line-height: 1.4; }
.brand-footer {
  display: flex;
  justify-content: space-between;
  color: rgba(255,255,255,.5);
  font-size: 10px;
  letter-spacing: .04em;
}
.system-online { display: inline-flex; align-items: center; gap: 8px; }
.system-online i { width: 6px; height: 6px; box-shadow: none; }

.form-panel {
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 42px clamp(30px, 6vw, 90px);
  background:
    radial-gradient(circle at 95% 5%, rgba(99,102,241,.09), transparent 25%),
    radial-gradient(circle at 5% 95%, rgba(124,58,237,.07), transparent 25%),
    #f8f9fd;
}
.form-card { width: min(430px, 100%); animation: formIn .65s ease both; }
@keyframes formIn { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
.mobile-brand { display: none; }
.product-logo { min-height: 54px; margin-bottom: 28px; display: flex; align-items: center; }
.product-logo img { display: block; max-width: 190px; max-height: 60px; object-fit: contain; object-position: left center; }
.welcome { margin-bottom: 30px; }
.secure-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 16px;
  padding: 7px 10px;
  border: 1px solid #dddafe;
  border-radius: 999px;
  color: #4f46e5;
  background: #eeedff;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .07em;
  text-transform: uppercase;
}
.secure-badge svg { width: 14px; }
.welcome h2 { margin: 0; color: #171b2c; font-size: clamp(30px, 3vw, 38px); letter-spacing: -.04em; }
.welcome p { margin: 10px 0 0; color: var(--muted); font-size: 13px; line-height: 1.6; }

.alert {
  margin: -10px 0 22px;
  padding: 13px 14px;
  display: flex;
  align-items: center;
  gap: 11px;
  border: 1px solid #fecaca;
  border-radius: 13px;
  color: #991b1b;
  background: #fff1f2;
}
.alert-icon { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 9px; background: #fee2e2; }
.alert-icon svg { width: 18px; }
.alert strong, .alert small { display: block; }
.alert strong { margin-bottom: 2px; font-size: 12px; }
.alert small { font-size: 10px; color: #b42318; }

.login-form { display: grid; gap: 20px; }
.field label { display: block; margin-bottom: 8px; color: #344054; font-size: 12px; font-weight: 700; }
.input-box { position: relative; }
.input-box input {
  width: 100%;
  height: 54px;
  padding: 0 48px;
  border: 1px solid var(--line);
  border-radius: 13px;
  outline: none;
  color: #172033;
  background: rgba(255,255,255,.9);
  font-size: 13px;
  box-shadow: 0 1px 2px rgba(16,24,40,.025);
  transition: border-color .2s ease, box-shadow .2s ease, background .2s ease;
}
.input-box input::placeholder { color: #98a2b3; }
.input-box input:hover { border-color: #b9c0ce; }
.input-box input:focus { border-color: #6366f1; background: #fff; box-shadow: 0 0 0 4px rgba(99,102,241,.11); }
.input-icon {
  position: absolute;
  left: 16px;
  top: 50%;
  z-index: 1;
  color: #7b8497;
  transform: translateY(-50%);
  pointer-events: none;
}
.input-icon svg { width: 18px; }
.input-box:focus-within .input-icon { color: #4f46e5; }
.password-toggle {
  position: absolute;
  right: 8px;
  top: 50%;
  width: 38px;
  height: 38px;
  padding: 0;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 9px;
  color: #7b8497;
  background: transparent;
  cursor: pointer;
}
.password-toggle:hover { color: #4f46e5; background: #f0efff; }
.password-toggle svg { width: 18px; grid-area: 1 / 1; }
.eye-off { display: none; }
.password-toggle.showing .eye-open { display: none; }
.password-toggle.showing .eye-off { display: block; }

.submit-btn {
  height: 55px;
  margin-top: 4px;
  padding: 0 8px 0 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  border: 0;
  border-radius: 13px;
  color: #fff;
  background: linear-gradient(100deg, #4338ca, #6d28d9);
  box-shadow: 0 12px 26px rgba(79,70,229,.24);
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
  transition: transform .2s ease, box-shadow .2s ease;
}
.submit-btn:hover { transform: translateY(-2px); box-shadow: 0 16px 30px rgba(79,70,229,.3); }
.submit-btn:active { transform: translateY(0); }
.button-arrow { width: 31px; height: 31px; display: grid; place-items: center; border-radius: 9px; background: rgba(255,255,255,.14); }
.button-arrow svg { width: 17px; }
.spinner { display: none; width: 18px; height: 18px; border: 2px solid rgba(255,255,255,.4); border-top-color: #fff; border-radius: 50%; animation: spin .7s linear infinite; }
.submit-btn.loading .button-text, .submit-btn.loading .button-arrow { display: none; }
.submit-btn.loading .spinner { display: block; }
@keyframes spin { to { transform: rotate(360deg); } }

.privacy-note {
  margin-top: 25px;
  padding: 13px 15px;
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid #e8eaf0;
  border-radius: 12px;
  color: #697386;
  background: rgba(255,255,255,.65);
  font-size: 10.5px;
  line-height: 1.45;
}
.privacy-note svg { flex: 0 0 18px; width: 18px; color: #16a085; }
.version { margin: 20px 0 0; color: #98a2b3; text-align: center; font-size: 10px; }
.version b { color: #667085; font-weight: 600; }

@media (max-width: 1050px) {
  .login-page { grid-template-columns: minmax(390px, .9fr) minmax(430px, 1.1fr); }
  .brand-content { padding-left: 42px; padding-right: 42px; }
  .feature-grid { grid-template-columns: 1fr; }
  .feature-card { min-height: 70px; padding: 13px; }
  .feature-icon { width: 38px; height: 38px; flex-basis: 38px; }
}

@media (max-width: 820px) {
  .login-page { display: block; overflow: auto; }
  .brand-panel { display: none; }
  .form-panel {
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 30px 22px;
    background:
      radial-gradient(circle at 100% 0, rgba(99,102,241,.14), transparent 32%),
      radial-gradient(circle at 0 100%, rgba(124,58,237,.1), transparent 30%),
      #f7f8fc;
  }
  .mobile-brand {
    width: min(430px, 100%);
    margin: 0 auto 38px;
    display: flex;
  }
  .mobile-brand .brand-mark { color: #fff; background: linear-gradient(135deg, #312e81, #6d28d9); }
  .mobile-brand strong { color: #25205f; }
  .mobile-brand small { color: #7b8497; }
  .brand-mark.small { width: 43px; height: 43px; border-radius: 12px; }
  .product-logo { margin-bottom: 23px; }
}

@media (max-width: 480px) {
  .form-panel { justify-content: flex-start; padding: max(24px, env(safe-area-inset-top)) 18px max(24px, env(safe-area-inset-bottom)); }
  .mobile-brand { margin-bottom: 32px; }
  .product-logo img { max-width: 165px; max-height: 52px; }
  .welcome { margin-bottom: 25px; }
  .welcome h2 { font-size: 30px; }
  .input-box input, .submit-btn { height: 52px; }
}

@media (max-height: 740px) and (min-width: 821px) {
  .brand-content { padding-top: 26px; padding-bottom: 22px; }
  .hero-copy { margin-bottom: 25px; }
  .hero-copy h1 { font-size: 42px; }
  .hero-copy p { margin-top: 14px; line-height: 1.55; }
  .feature-grid { margin-bottom: 22px; }
  .feature-card { min-height: 66px; padding: 11px 14px; }
  .form-panel { padding-top: 25px; padding-bottom: 25px; }
  .product-logo { margin-bottom: 16px; }
  .welcome { margin-bottom: 20px; }
  .welcome p { margin-top: 6px; }
  .login-form { gap: 14px; }
  .privacy-note { margin-top: 17px; }
  .version { margin-top: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
