:root {
  --bg: #03141f;
  --bg-soft: #0a2234;
  --panel: rgba(8, 30, 45, 0.72);
  --panel-2: rgba(10, 37, 56, 0.92);
  --stroke: rgba(255, 255, 255, 0.14);
  --text: #eef7ff;
  --muted: #96adbf;
  --primary: #179adf;
  --primary-2: #1cb79b;
  --danger: #ff87a2;
  --shadow-soft: 0 20px 60px rgba(1, 16, 28, 0.38);
  --shadow-hard: 0 38px 90px rgba(1, 12, 23, 0.5);
}

html[data-theme="light"],
body[data-theme="light"] {
  --bg: #e9f3fa;
  --bg-soft: #dcebf5;
  --panel: rgba(255, 255, 255, 0.74);
  --panel-2: rgba(255, 255, 255, 0.96);
  --stroke: rgba(27, 69, 99, 0.17);
  --text: #112131;
  --muted: #4f6478;
  --primary: #0f8ecf;
  --primary-2: #13ae96;
  --danger: #e64f76;
  --shadow-soft: 0 20px 60px rgba(51, 85, 110, 0.16);
  --shadow-hard: 0 35px 90px rgba(38, 67, 88, 0.22);
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
  margin: 0;
  font-family: Manrope, "Segoe UI", sans-serif;
  color: var(--text);
  background:
    radial-gradient(60vw 60vw at 0% -10%, rgba(23, 154, 223, 0.32), transparent 56%),
    radial-gradient(54vw 54vw at 100% 100%, rgba(28, 183, 155, 0.26), transparent 54%),
    linear-gradient(160deg, var(--bg) 0%, var(--bg-soft) 100%);
  transition: background 260ms ease, color 220ms ease;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.34;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
  background-size: 36px 36px;
}

button,
input {
  font: inherit;
}

.login-shell {
  position: relative;
  isolation: isolate;
  min-height: 100vh;
  width: min(1320px, 100% - 56px);
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(520px, 1fr) minmax(380px, 470px);
  align-items: center;
  column-gap: clamp(24px, 4vw, 70px);
  overflow: hidden;
}

.ambient-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: -1;
}

.orb {
  position: absolute;
  border-radius: 999px;
  filter: blur(4px);
  animation: float 12s ease-in-out infinite;
}

.orb-1 {
  width: 360px;
  height: 360px;
  top: -120px;
  left: -80px;
  background: radial-gradient(circle, rgba(23, 154, 223, 0.34), rgba(23, 154, 223, 0));
}

.orb-2 {
  width: 310px;
  height: 310px;
  top: 46%;
  right: -120px;
  animation-delay: 1.4s;
  background: radial-gradient(circle, rgba(28, 183, 155, 0.28), rgba(28, 183, 155, 0));
}

.orb-3 {
  width: 240px;
  height: 240px;
  bottom: -70px;
  left: 30%;
  animation-delay: 2.8s;
  background: radial-gradient(circle, rgba(8, 71, 114, 0.28), rgba(8, 71, 114, 0));
}

.brand-side,
.form-side {
  animation: rise 650ms ease both;
}

.form-side {
  animation-delay: 120ms;
}

.brand-side {
  padding: 28px 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 34px;
}

.brand-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand-logo {
  width: min(290px, 56vw);
  height: auto;
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--stroke);
  border-radius: 999px;
  padding: 10px 14px;
  cursor: pointer;
  color: var(--text);
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(12px);
  transition: transform 220ms ease, background-color 220ms ease, border-color 220ms ease;
}

.theme-toggle:hover {
  transform: translateY(-1px);
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.26);
}

.hero-copy {
  max-width: 700px;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  padding: 8px 13px;
  border-radius: 999px;
  border: 1px solid var(--stroke);
  background: rgba(255, 255, 255, 0.05);
  color: var(--muted);
  letter-spacing: 0.015em;
  margin-bottom: 16px;
}

.hero-copy h1 {
  margin: 0;
  font-family: "Space Grotesk", Manrope, sans-serif;
  font-size: clamp(36px, 5vw, 70px);
  line-height: 1.01;
  max-width: 14ch;
}

.hero-copy p {
  margin: 18px 0 0;
  max-width: 58ch;
  color: var(--muted);
  font-size: clamp(16px, 1.4vw, 19px);
  line-height: 1.65;
}

.feature-list {
  margin-top: 30px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.feature-card {
  min-height: 148px;
  padding: 16px;
  border-radius: 20px;
  border: 1px solid var(--stroke);
  background: linear-gradient(165deg, rgba(255, 255, 255, 0.11), rgba(255, 255, 255, 0.03));
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(14px);
  transition: transform 260ms ease, border-color 260ms ease, box-shadow 260ms ease;
}

.feature-card:hover {
  transform: translateY(-3px);
  border-color: rgba(255, 255, 255, 0.3);
  box-shadow: var(--shadow-hard);
}

.feature-card strong {
  display: block;
  margin-bottom: 8px;
  font-size: 15px;
}

.feature-card span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.form-side {
  display: grid;
  place-items: center start;
  padding: 0;
}

.login-card {
  width: min(100%, 490px);
  border-radius: 30px;
  border: 1px solid var(--stroke);
  background: linear-gradient(170deg, var(--panel), var(--panel-2));
  box-shadow: var(--shadow-hard);
  backdrop-filter: blur(16px);
  padding: clamp(24px, 3vw, 34px);
}

.login-card h2 {
  margin: 0;
  font-size: clamp(28px, 3.2vw, 34px);
  letter-spacing: -0.01em;
}

.login-card p {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.6;
}

.login-form {
  margin-top: 24px;
  display: grid;
  gap: 14px;
}

.field {
  display: grid;
  gap: 8px;
}

.field label {
  color: var(--muted);
  font-size: 14px;
}

.field input {
  width: 100%;
  height: 54px;
  border-radius: 15px;
  border: 1px solid var(--stroke);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  padding: 0 14px;
  outline: none;
  transition: border-color 180ms ease, box-shadow 180ms ease, transform 180ms ease, background-color 180ms ease;
}

.field input::placeholder {
  color: color-mix(in srgb, var(--muted) 86%, transparent);
}

.field input:focus {
  border-color: color-mix(in srgb, var(--primary) 70%, white);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--primary) 20%, transparent);
  transform: translateY(-1px);
  background: rgba(255, 255, 255, 0.1);
}

.login-submit {
  position: relative;
  overflow: hidden;
  height: 54px;
  border: 0;
  border-radius: 15px;
  cursor: pointer;
  color: #fff;
  font-weight: 700;
  letter-spacing: 0.01em;
  background: linear-gradient(92deg, var(--primary), var(--primary-2));
  transition: transform 180ms ease, filter 180ms ease;
}

.login-submit::before {
  content: "";
  position: absolute;
  top: -110%;
  left: -35%;
  width: 36%;
  height: 320%;
  transform: rotate(20deg);
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.35), transparent);
  transition: left 340ms ease;
}

.login-submit:hover {
  transform: translateY(-1px);
  filter: saturate(1.1);
}

.login-submit:hover::before {
  left: 115%;
}

.login-submit:disabled {
  cursor: wait;
  opacity: 0.82;
}

.login-message {
  min-height: 20px;
  margin-top: 2px;
  color: var(--danger);
  font-size: 14px;
}

.login-meta {
  margin-top: 16px;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: var(--muted);
  font-size: 13px;
}

.meta-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--primary), var(--primary-2));
  box-shadow: 0 0 0 7px color-mix(in srgb, var(--primary) 20%, transparent);
}

@media (max-width: 1180px) {
  .feature-list {
    grid-template-columns: 1fr;
  }

  .feature-card {
    min-height: auto;
  }
}

@media (max-width: 960px) {
  .login-shell {
    width: 100%;
    grid-template-columns: 1fr;
    row-gap: 12px;
  }

  .brand-side {
    padding-bottom: 8px;
    gap: 30px;
  }

  .hero-copy h1 {
    max-width: none;
    font-size: clamp(32px, 9vw, 50px);
  }

  .hero-copy p {
    max-width: none;
  }
}

@media (max-width: 640px) {
  .login-shell {
    width: 100%;
  }

  .brand-side {
    padding: 22px 18px 8px;
  }

  .form-side {
    padding: 12px 16px 24px;
  }

  .brand-top {
    align-items: flex-start;
    flex-direction: column;
  }

  .theme-toggle {
    width: 100%;
    justify-content: center;
  }

  .login-card {
    border-radius: 22px;
    padding: 20px;
  }

  .feature-list {
    margin-top: 20px;
  }
}

@keyframes float {
  0%,
  100% {
    transform: translateY(0px);
  }
  50% {
    transform: translateY(-16px);
  }
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
