@import url("https://fonts.googleapis.com/css2?family=IBM+Plex+Sans:wght@400;500;600;700&family=Space+Grotesk:wght@500;600;700&display=swap");

:root {
  --ink: #f3f7fa;
  --muted: rgba(243, 247, 250, 0.68);
  --deep: #0a1a26;
  --deep-2: #102a3c;
  --deep-3: #16384f;
  --teal: #1f8a70;
  --teal-2: #146b58;
  --amber: #c9782b;
  --line: rgba(255, 255, 255, 0.12);
  --field: rgba(8, 22, 34, 0.55);
  --danger: #e35d5d;
  --danger-bg: rgba(227, 93, 93, 0.12);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
  font-family: "IBM Plex Sans", system-ui, sans-serif;
  color: var(--ink);
  background: var(--deep);
}

body {
  min-height: 100vh;
  overflow-x: hidden;
  background:
    radial-gradient(1100px 520px at 8% 12%, rgba(31, 138, 112, 0.28), transparent 58%),
    radial-gradient(900px 480px at 92% 8%, rgba(201, 120, 43, 0.16), transparent 52%),
    radial-gradient(700px 420px at 70% 95%, rgba(20, 107, 88, 0.18), transparent 55%),
    linear-gradient(160deg, #07131c 0%, var(--deep-2) 48%, #0c2030 100%);
}

/* Atmospheric mesh */
.login-mesh {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: 0.35;
  background-image:
    linear-gradient(rgba(255,255,255,0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.045) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(ellipse 70% 60% at 30% 40%, #000 20%, transparent 75%);
  animation: meshDrift 22s linear infinite;
}

@keyframes meshDrift {
  from { background-position: 0 0, 0 0; }
  to { background-position: 0 64px, 64px 0; }
}

.login-orb {
  position: fixed;
  width: 42vw;
  height: 42vw;
  max-width: 560px;
  max-height: 560px;
  border-radius: 50%;
  border: 1px solid rgba(31, 138, 112, 0.22);
  pointer-events: none;
  z-index: 0;
  animation: orbPulse 8s ease-in-out infinite;
}
.login-orb--a {
  left: -8%;
  top: 18%;
  box-shadow: inset 0 0 80px rgba(31, 138, 112, 0.08);
}
.login-orb--b {
  right: -10%;
  bottom: -12%;
  width: 36vw;
  height: 36vw;
  border-color: rgba(201, 120, 43, 0.18);
  animation-delay: -3s;
  box-shadow: inset 0 0 70px rgba(201, 120, 43, 0.06);
}

@keyframes orbPulse {
  0%, 100% { transform: scale(1); opacity: 0.7; }
  50% { transform: scale(1.04); opacity: 1; }
}

.login-shell {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.15fr 0.95fr;
}

@media (max-width: 900px) {
  .login-shell { grid-template-columns: 1fr; }
  .login-brand { min-height: 38vh; padding: 2.2rem 1.4rem 1.2rem !important; }
  .login-brand h1 { font-size: clamp(2.8rem, 14vw, 4.2rem) !important; }
  .login-panel { padding: 1.5rem 1.25rem 2.5rem !important; }
}

.login-brand {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 3.5rem 3.2rem 3.8rem;
  position: relative;
}

.login-brand::after {
  content: "";
  position: absolute;
  inset: 12% 8% 14% auto;
  width: 1px;
  background: linear-gradient(180deg, transparent, rgba(255,255,255,0.18), transparent);
  opacity: 0.8;
}

@media (max-width: 900px) {
  .login-brand::after { display: none; }
}

.brand-kicker {
  font-size: 0.78rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(243, 247, 250, 0.55);
  margin-bottom: 1.1rem;
  animation: riseIn 0.7s ease both;
}

.login-brand h1 {
  font-family: "Space Grotesk", sans-serif;
  font-weight: 700;
  font-size: clamp(3.6rem, 7.5vw, 6.4rem);
  line-height: 0.92;
  letter-spacing: -0.04em;
  margin: 0 0 1rem;
  color: #fff;
  animation: riseIn 0.8s ease both;
  animation-delay: 0.05s;
}

.login-brand h1 em {
  font-style: normal;
  color: var(--teal);
}

.brand-line {
  max-width: 28rem;
  margin: 0;
  font-size: 1.05rem;
  line-height: 1.55;
  color: var(--muted);
  animation: riseIn 0.85s ease both;
  animation-delay: 0.12s;
}

.brand-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem 1.25rem;
  margin-top: 1.8rem;
  font-size: 0.82rem;
  color: rgba(243, 247, 250, 0.52);
  animation: riseIn 0.9s ease both;
  animation-delay: 0.18s;
}

.brand-meta span {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}

.brand-meta i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--teal);
  box-shadow: 0 0 0 3px rgba(31, 138, 112, 0.22);
  animation: liveBlink 2.4s ease-in-out infinite;
}

@keyframes liveBlink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.45; }
}

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

.login-panel {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2.5rem 2.4rem;
}

.login-form-wrap {
  width: 100%;
  max-width: 400px;
  animation: riseIn 0.75s ease both;
  animation-delay: 0.1s;
}

.form-head {
  margin-bottom: 1.55rem;
}

.form-head h2 {
  font-family: "Space Grotesk", sans-serif;
  font-size: 1.55rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0 0 0.35rem;
}

.form-head p {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.login-alert {
  margin: 0 0 1.1rem;
  padding: 0.85rem 0.95rem;
  border-radius: 12px;
  border: 1px solid rgba(227, 93, 93, 0.35);
  background: var(--danger-bg);
  color: #ffc9c9;
  font-size: 0.9rem;
  line-height: 1.4;
}

.field {
  margin-bottom: 1rem;
}

.field label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: rgba(243, 247, 250, 0.72);
  margin-bottom: 0.45rem;
}

.field input {
  width: 100%;
  height: 48px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--field);
  color: #fff;
  padding: 0 0.95rem;
  font-size: 1rem;
  font-family: inherit;
  outline: none;
  transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
}

.field input::placeholder {
  color: rgba(243, 247, 250, 0.35);
}

.field input:focus {
  border-color: rgba(31, 138, 112, 0.7);
  background: rgba(8, 22, 34, 0.72);
  box-shadow: 0 0 0 3px rgba(31, 138, 112, 0.18);
}

.field-pass {
  position: relative;
}

.field-pass input {
  padding-right: 3rem;
}

.toggle-pass {
  position: absolute;
  right: 0.35rem;
  top: 50%;
  transform: translateY(-50%);
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: rgba(243, 247, 250, 0.55);
  cursor: pointer;
  display: grid;
  place-items: center;
}

.toggle-pass:hover { color: #fff; background: rgba(255,255,255,0.06); }

.btn-login {
  width: 100%;
  height: 50px;
  margin-top: 0.55rem;
  border: 0;
  border-radius: 12px;
  cursor: pointer;
  font-family: "Space Grotesk", sans-serif;
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: 0.02em;
  color: #fff;
  background: linear-gradient(135deg, var(--teal), var(--teal-2));
  box-shadow: 0 14px 28px rgba(31, 138, 112, 0.28);
  transition: transform .15s ease, filter .15s ease, box-shadow .15s ease;
}

.btn-login:hover {
  transform: translateY(-1px);
  filter: brightness(1.06);
  box-shadow: 0 18px 34px rgba(31, 138, 112, 0.34);
}

.btn-login:active { transform: translateY(0); }

.btn-login:disabled {
  opacity: 0.65;
  cursor: not-allowed;
  transform: none;
}

.form-foot {
  margin-top: 1.35rem;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  font-size: 0.78rem;
  color: rgba(243, 247, 250, 0.45);
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
  }
}
