:root {
  --bg-900: #07141d;
  --bg-800: #0b202d;
  --bg-700: #103243;
  --surface: rgba(7, 20, 29, 0.78);
  --surface-soft: rgba(255, 255, 255, 0.04);
  --line: rgba(154, 203, 232, 0.24);
  --text-main: #e9f3f9;
  --text-muted: #9ec0d2;
  --accent: #3eb7dd;
  --accent-soft: #8be6ff;
  --error: #ff7a7a;
  --ok: #87d9a3;
  --shadow: 0 20px 60px rgba(0, 0, 0, 0.45);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  position: relative;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 15% 20%, rgba(62, 183, 221, 0.22), transparent 35%),
    radial-gradient(circle at 85% 75%, rgba(25, 123, 176, 0.24), transparent 35%),
    linear-gradient(135deg, var(--bg-900), var(--bg-800) 55%, #081923);
  color: var(--text-main);
  font-family: "Manrope", system-ui, -apple-system, "Segoe UI", sans-serif;
}

.bg-grid {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(158, 192, 210, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(158, 192, 210, 0.05) 1px, transparent 1px);
  background-size: 36px 36px;
  mask-image: radial-gradient(circle at center, black 30%, transparent 80%);
  z-index: 0;
}

.bg-glow {
  position: fixed;
  border-radius: 100%;
  filter: blur(60px);
  pointer-events: none;
  z-index: 0;
}

.bg-glow-left {
  width: 360px;
  height: 360px;
  left: -130px;
  top: 18%;
  background: rgba(27, 178, 224, 0.2);
  animation: floatA 8s ease-in-out infinite;
}

.bg-glow-right {
  width: 460px;
  height: 460px;
  right: -160px;
  bottom: -90px;
  background: rgba(17, 108, 164, 0.24);
  animation: floatB 10s ease-in-out infinite;
}

.layout {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  width: min(1140px, 92vw);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.2fr minmax(320px, 420px);
  gap: 38px;
  align-items: center;
  padding: 48px 0;
}

.intro {
  animation: enterUp 0.7s ease-out both;
}

.eyebrow {
  margin: 0 0 14px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent-soft);
  font-size: 0.76rem;
}

h1 {
  margin: 0;
  font-family: "Space Grotesk", "Manrope", sans-serif;
  font-size: clamp(2rem, 3.8vw, 3.5rem);
  line-height: 1.04;
}

.lead {
  margin-top: 18px;
  max-width: 62ch;
  color: var(--text-muted);
  line-height: 1.55;
}

.login-panel {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
  backdrop-filter: blur(10px);
  box-shadow: var(--shadow);
  padding: 28px;
  animation: enterUp 0.75s ease-out 0.1s both;
}

.panel-top h2 {
  margin: 0;
  font-family: "Space Grotesk", "Manrope", sans-serif;
  letter-spacing: 0.01em;
}

.panel-top p {
  margin: 10px 0 0;
  color: var(--text-muted);
  font-size: 0.92rem;
}

form {
  margin-top: 22px;
}

.field-label {
  display: block;
  margin: 14px 0 8px;
  font-size: 0.82rem;
  font-weight: 600;
  color: #bfd9e7;
}

input[type="text"],
input[type="email"],
input[type="password"] {
  width: 100%;
  border: 1px solid rgba(154, 203, 232, 0.28);
  background: rgba(7, 21, 30, 0.7);
  color: var(--text-main);
  border-radius: 10px;
  padding: 12px 13px;
  font-size: 0.95rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(62, 183, 221, 0.18);
}

input::placeholder {
  color: #67879a;
}

.field-row {
  margin-top: 14px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.remember-row {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text-muted);
  font-size: 0.85rem;
}

input[type="checkbox"] {
  accent-color: var(--accent);
}

.text-link {
  margin-top: 12px;
  display: inline-flex;
  width: auto;
  border: 0;
  background: none;
  padding: 0;
  color: var(--accent-soft);
  text-decoration: none;
  font-size: 0.86rem;
  font-weight: 600;
  cursor: pointer;
}

.text-link:hover {
  text-decoration: underline;
  transform: none;
  filter: none;
}

button {
  margin-top: 18px;
  width: 100%;
  border: 0;
  border-radius: 11px;
  padding: 13px 15px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: #05212e;
  background: linear-gradient(120deg, var(--accent), var(--accent-soft));
  cursor: pointer;
  transition: transform 0.18s ease, filter 0.18s ease, opacity 0.18s ease;
}

button:hover:enabled {
  transform: translateY(-1px);
  filter: brightness(1.03);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.65;
}

.message {
  min-height: 22px;
  margin: 14px 0 0;
  font-size: 0.88rem;
  color: var(--error);
}

.message.info {
  color: #efc878;
}

.message.success {
  color: var(--ok);
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.modal.show {
  display: flex;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(3, 9, 14, 0.7);
}

.modal-card {
  position: relative;
  width: min(460px, 100%);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 24px;
  background: rgba(8, 23, 33, 0.96);
  box-shadow: var(--shadow);
  z-index: 1;
}

.modal-card h3 {
  margin: 0;
  font-family: "Space Grotesk", "Manrope", sans-serif;
}

.modal-text {
  margin: 10px 0 2px;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.modal-close {
  position: absolute;
  top: 10px;
  right: 12px;
  width: auto;
  margin-top: 0;
  background: none;
  color: var(--text-muted);
  font-size: 1.5rem;
  line-height: 1;
  padding: 4px;
}

.modal-close:hover {
  transform: none;
  filter: none;
  color: var(--text-main);
}

body.modal-open {
  overflow: hidden;
}

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

@keyframes floatA {
  0%,
  100% {
    transform: translateY(0px);
  }
  50% {
    transform: translateY(12px);
  }
}

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

@media (max-width: 980px) {
  .layout {
    grid-template-columns: 1fr;
    gap: 26px;
    padding: 26px 0 34px;
  }
}

@media (max-width: 640px) {
  .login-panel {
    padding: 22px 18px;
  }

  .field-row {
    gap: 10px;
  }
}
