@import url('https://fonts.googleapis.com/css2?family=Bebas+Neue&family=DM+Sans:wght@300;400;500;600&display=swap');

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --navy:      #00008B;
  --navy-dark: #00005e;
  --navy-mid:  #0000b8;
  --gold:      #f0c040;
  --white:     #ffffff;
  --off-white: #f4f6fb;
  --gray:      #8a8fa8;
  --text:      #1a1a2e;
  --error:     #e53e3e;
}

body {
  font-family: 'DM Sans', sans-serif;
  background: var(--navy-dark);
  color: var(--white);
  height: 100vh;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ── Background texture ── */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse at 20% 50%, rgba(0,0,184,0.4) 0%, transparent 60%),
    radial-gradient(ellipse at 80% 20%, rgba(240,192,64,0.08) 0%, transparent 50%);
  pointer-events: none;
}

/* ── Grid lines overlay ── */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  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: 40px 40px;
  pointer-events: none;
}

/* ── Main container ── */
.login-container {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  width: min(960px, 95vw);
  height: min(580px, 92vh);
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 40px 100px rgba(0,0,0,0.6), 0 0 0 1px rgba(255,255,255,0.07);
  animation: rise 0.7s cubic-bezier(.22,1,.36,1) both;
}

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

/* ── Left: branding panel ── */
.login-illustration {
  background: linear-gradient(145deg, var(--navy-dark) 0%, var(--navy) 60%, var(--navy-mid) 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 40px;
  position: relative;
  overflow: hidden;
}

.login-illustration::before {
  content: '';
  position: absolute;
  width: 300px; height: 300px;
  border-radius: 50%;
  border: 60px solid rgba(255,255,255,0.04);
  bottom: -80px; left: -80px;
}

.login-illustration::after {
  content: '';
  position: absolute;
  width: 180px; height: 180px;
  border-radius: 50%;
  border: 40px solid rgba(240,192,64,0.07);
  top: -40px; right: -40px;
}

.logo-wrap {
  position: relative;
  z-index: 1;
  width: 150px; height: 150px;
  border-radius: 50%;
  border: 3px solid rgba(240,192,64,0.5);
  box-shadow: 0 0 0 8px rgba(240,192,64,0.08), 0 20px 60px rgba(0,0,0,0.4);
  overflow: hidden;
  margin-bottom: 28px;
  animation: pulse-ring 3s ease-in-out infinite;
}

@keyframes pulse-ring {
  0%, 100% { box-shadow: 0 0 0 8px rgba(240,192,64,0.08), 0 20px 60px rgba(0,0,0,0.4); }
  50%       { box-shadow: 0 0 0 16px rgba(240,192,64,0.04), 0 20px 60px rgba(0,0,0,0.4); }
}

.logo-wrap img {
  width: 100%; height: 100%;
  object-fit: cover;
}

.brand-name {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1.6rem;
  letter-spacing: 0.12em;
  text-align: center;
  color: var(--white);
  line-height: 1.2;
  position: relative; z-index: 1;
}

.brand-sub {
  font-size: 0.72rem;
  letter-spacing: 0.25em;
  color: var(--gold);
  text-transform: uppercase;
  margin-top: 8px;
  text-align: center;
  position: relative; z-index: 1;
}

/* ── Right: form panel ── */
.login-form {
  background: var(--white);
  padding: 52px 48px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  color: var(--text);
}

.login-form h2 {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 2.2rem;
  letter-spacing: 0.06em;
  color: var(--navy);
  margin-bottom: 6px;
}

.login-form .subtitle {
  font-size: 0.82rem;
  color: var(--gray);
  margin-bottom: 32px;
  letter-spacing: 0.02em;
}

.login-form label {
  display: block;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--navy);
  margin-bottom: 6px;
  margin-top: 18px;
}

.login-form label:first-of-type { margin-top: 0; }

.login-form input {
  width: 100%;
  padding: 11px 14px;
  border: 1.5px solid #dde1ef;
  border-radius: 8px;
  background: var(--off-white);
  color: var(--text);
  font-family: 'DM Sans', sans-serif;
  font-size: 0.9rem;
  transition: border-color 0.2s, box-shadow 0.2s;
  outline: none;
}

.login-form input:focus {
  border-color: var(--navy);
  box-shadow: 0 0 0 3px rgba(0,0,139,0.1);
  background: var(--white);
}

.login-form input::placeholder { color: #b0b5c8; }

.login-form button[type="submit"] {
  margin-top: 28px;
  width: 100%;
  padding: 13px;
  background: var(--navy);
  color: var(--white);
  border: none;
  border-radius: 8px;
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1.1rem;
  letter-spacing: 0.12em;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s, box-shadow 0.2s;
  box-shadow: 0 4px 20px rgba(0,0,139,0.3);
}

.login-form button[type="submit"]:hover {
  background: var(--navy-mid);
  box-shadow: 0 6px 24px rgba(0,0,139,0.45);
}

.login-form button[type="submit"]:active { transform: scale(0.98); }

.login-form .forgot {
  display: inline-block;
  margin-top: 14px;
  font-size: 0.8rem;
  color: var(--gray);
  text-decoration: none;
  transition: color 0.2s;
}

.login-form .forgot:hover { color: var(--navy); }

#message {
  margin-top: 12px;
  font-size: 0.82rem;
  color: var(--error);
  min-height: 18px;
}

/* ── Forgot Password Modal ── */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,40,0.75);
  backdrop-filter: blur(4px);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 999;
  animation: fadein 0.2s ease;
}

@keyframes fadein { from { opacity: 0; } to { opacity: 1; } }

.modal-content {
  background: var(--white);
  padding: 40px;
  border-radius: 16px;
  width: min(420px, 92vw);
  color: var(--text);
  box-shadow: 0 30px 80px rgba(0,0,0,0.4);
  animation: rise 0.35s cubic-bezier(.22,1,.36,1) both;
}

.modal-content h3 {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1.7rem;
  letter-spacing: 0.06em;
  color: var(--navy);
  margin-bottom: 6px;
}

.modal-content p.hint {
  font-size: 0.78rem;
  color: var(--gray);
  margin-bottom: 20px;
}

.modal-content label {
  display: block;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--navy);
  margin-top: 16px;
  margin-bottom: 5px;
}

.modal-content input {
  width: 100%;
  padding: 10px 13px;
  border: 1.5px solid #dde1ef;
  border-radius: 8px;
  background: var(--off-white);
  color: var(--text);
  font-family: 'DM Sans', sans-serif;
  font-size: 0.88rem;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.modal-content input:focus {
  border-color: var(--navy);
  box-shadow: 0 0 0 3px rgba(0,0,139,0.1);
}

.modal-content button {
  margin-top: 24px;
  width: 100%;
  padding: 12px;
  background: var(--navy);
  color: var(--white);
  border: none;
  border-radius: 8px;
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1.05rem;
  letter-spacing: 0.1em;
  cursor: pointer;
  transition: background 0.2s, box-shadow 0.2s;
  box-shadow: 0 4px 16px rgba(0,0,139,0.25);
}

.modal-content button:hover { background: var(--navy-mid); }

#forgotMessage {
  margin-top: 10px;
  font-size: 0.8rem;
  min-height: 18px;
  color: var(--error);
}

#forgotMessage.success { color: #22863a; }

/* ── Responsive ── */
@media (max-width: 640px) {
  .login-container { grid-template-columns: 1fr; height: auto; }
  .login-illustration { padding: 36px 24px; }
  .login-form { padding: 36px 28px; }
}