:root {
  --bg-start: #7cd0f0;
  --bg-end: #4fb3e0;
  --shape-color: rgba(255, 255, 255, 0.22);
  --heading-text: #ffffff;
  --card-bg: #16357a;
  --card-shadow: rgba(15, 35, 75, 0.35);
  --input-bg: #eef1f5;
  --input-text: #1a1a1a;
  --input-icon: #6b7280;
  --input-placeholder: #8892a0;
  --accent: #f7b733;
  --accent-hover: #e0a020;
  --muted: #c3d2ea;
  --link-text: #dbe6f5;
  --toggle-bg: #ffffff;
  --toggle-icon: #16357a;
  --error-bg: rgba(239, 68, 68, 0.18);
  --error-text: #ffe4e4;
}

:root[data-theme="dark"] {
  --bg-start: #0b1a33;
  --bg-end: #16294d;
  --shape-color: rgba(255, 255, 255, 0.06);
  --heading-text: #eef4fb;
  --card-bg: #0f1f3d;
  --card-shadow: rgba(0, 0, 0, 0.5);
  --input-bg: #e5e9f0;
  --input-text: #1a1a1a;
  --input-icon: #6b7280;
  --input-placeholder: #8892a0;
  --accent: #f7b733;
  --accent-hover: #e0a020;
  --muted: #93a3bd;
  --link-text: #b9c9e3;
  --toggle-bg: #0f1f3d;
  --toggle-icon: #eef4fb;
  --error-bg: rgba(239, 68, 68, 0.15);
  --error-text: #f87171;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: -apple-system, Segoe UI, Roboto, sans-serif;
  background: linear-gradient(160deg, var(--bg-start), var(--bg-end));
  color: var(--heading-text);
  position: relative;
  overflow-x: hidden;
  transition: background 0.2s ease;
}

.bg-shape {
  position: fixed;
  border-radius: 50%;
  background: var(--shape-color);
  pointer-events: none;
}
.bg-shape.s1 { width: 140px; height: 140px; top: 8%; left: 6%; }
.bg-shape.s2 { width: 90px; height: 90px; top: 65%; left: 10%; }
.bg-shape.s3 { width: 60px; height: 60px; top: 20%; right: 12%; }
.bg-shape.s4 { width: 180px; height: 180px; bottom: -60px; right: -40px; }
.bg-shape.diamond {
  border-radius: 6px;
  transform: rotate(45deg);
}
.bg-shape.s5 { width: 30px; height: 30px; top: 40%; left: 20%; }
.bg-shape.s6 { width: 24px; height: 24px; top: 15%; left: 45%; }

.login-wrap {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem 1.5rem;
}

.login-heading {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  text-align: center;
  margin: 0 0 1.5rem;
}

.lock-icon { width: 84px; height: 84px; margin-bottom: 1.25rem; }

.login-card {
  background: var(--card-bg);
  border-radius: 20px;
  box-shadow: 0 20px 45px var(--card-shadow);
  padding: 2rem 2.25rem 2.25rem;
  width: 100%;
  max-width: 360px;
}

.login-card h2 {
  margin: 0 0 1.25rem;
  text-align: center;
  font-size: 1.3rem;
  letter-spacing: 0.03em;
  color: var(--heading-text);
}

.input-icon-field { position: relative; margin-bottom: 0.85rem; }

.input-icon-field svg {
  position: absolute;
  left: 0.85rem;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  color: var(--input-icon);
}

.input-icon-field input {
  width: 100%;
  padding: 0.7rem 0.9rem 0.7rem 2.4rem;
  border-radius: 8px;
  border: none;
  background: var(--input-bg);
  color: var(--input-text);
  font-size: 0.85rem;
}

.input-icon-field input::placeholder { color: var(--input-placeholder); }

.login-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 0.5rem 0 1.25rem;
  font-size: 0.75rem;
}

.remember-me {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--muted);
}

.login-row a {
  color: var(--link-text);
  text-decoration: none;
}
.login-row a:hover { text-decoration: underline; }

.btn-login {
  width: 100%;
  padding: 0.75rem;
  border-radius: 999px;
  border: none;
  background: var(--accent);
  color: #1a1a1a;
  font-weight: 700;
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
}
.btn-login:hover { background: var(--accent-hover); }

.error-box {
  background: var(--error-bg);
  color: var(--error-text);
  padding: 0.6rem 0.85rem;
  border-radius: 8px;
  font-size: 0.8rem;
  margin-bottom: 1rem;
  text-align: center;
}

.theme-toggle {
  position: fixed;
  left: 1.5rem;
  bottom: 1.5rem;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: none;
  background: var(--toggle-bg);
  color: var(--toggle-icon);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  z-index: 2;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}
.theme-toggle svg { width: 20px; height: 20px; }

@media (max-width: 480px) {
  .login-heading { font-size: 1.2rem; }
  .lock-icon { width: 64px; height: 64px; }
  .login-card { padding: 1.5rem 1.5rem 1.75rem; }
  .bg-shape.s1, .bg-shape.s4 { opacity: 0.5; }
}
