:root {
  --blue: #0a2848;
  --blue-2: #123b63;
  --gold-dark: #b5813a;
  --gold-light: #f3dd86;
  --ink: #112235;
  --muted: #6c7684;
  --line: #d9e1e8;
  --paper: #f6f3ec;
  --surface: #ffffff;
  --surface-warm: #fbf7ee;
  --error: #a33b32;
  --success: #14795d;
  --shadow: 0 18px 48px rgba(10, 40, 72, 0.14);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  font-family: "Segoe UI", Arial, sans-serif;
  background: var(--paper);
  color: var(--ink);
}

.login-page {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(420px, 1fr) minmax(420px, 0.95fr);
}

.login-visual {
  position: relative;
  min-height: 100vh;
  padding: 64px;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(243, 221, 134, 0.13), rgba(10, 40, 72, 0)),
    var(--blue);
  color: #fff;
}

.grid-overlay {
  position: absolute;
  inset: 0;
  opacity: 0.16;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.1) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.1) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.9), transparent 78%);
}

.login-visual::before {
  content: "";
  position: absolute;
  inset: auto -12% -22% 8%;
  height: 42%;
  background: linear-gradient(135deg, rgba(243, 221, 134, 0.32), rgba(18, 60, 102, 0.08));
  transform: skewY(-7deg);
  border-top: 1px solid rgba(243, 221, 134, 0.28);
}

.visual-content {
  position: relative;
  z-index: 1;
  max-width: 560px;
}

.eyebrow,
.section-label {
  margin: 0 0 14px;
  color: var(--gold-light);
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.78rem;
  font-weight: 700;
}

.visual-content h1 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2.4rem, 5.5vw, 4.6rem);
  line-height: 1.02;
  letter-spacing: 0;
  font-weight: 700;
}

.visual-wordmark {
  display: block;
  width: min(100%, 420px);
  height: auto;
  margin-bottom: 8px;
}

.visual-copy {
  max-width: 480px;
  margin: 22px 0 0;
  color: rgba(255, 255, 255, 0.78);
  font-size: 1.02rem;
  line-height: 1.65;
}

.login-panel {
  min-height: 100vh;
  padding: 48px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.login-card {
  width: min(100%, 460px);
  padding: 42px;
  background: var(--surface);
  border: 1px solid rgba(10, 40, 72, 0.08);
  box-shadow: var(--shadow);
}

.brand {
  display: flex;
  justify-content: center;
  margin-bottom: 30px;
}

.brand-logo {
  max-width: 220px;
  max-height: 70px;
  object-fit: contain;
}

.brand-lockup {
  align-items: center;
  gap: 16px;
}

.brand-icon {
  width: 52px;
  height: 52px;
  object-fit: contain;
}

.brand-wordmark {
  height: 44px;
  object-fit: contain;
}

.card-heading {
  margin-bottom: 28px;
}

.card-heading h2 {
  margin: 0 0 10px;
  color: var(--blue);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.9rem;
}

.card-heading p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
  font-size: 0.95rem;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.login-form label {
  color: var(--ink);
  font-size: 0.82rem;
  font-weight: 700;
  margin-top: 8px;
}

.login-form input {
  width: 100%;
  height: 48px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  font: inherit;
  padding: 0 14px;
  outline: none;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.login-form input::placeholder {
  color: rgba(17, 34, 53, 0.4);
}

.login-form input:focus {
  border-color: var(--gold-dark);
  box-shadow: 0 0 0 3px rgba(181, 129, 58, 0.16);
}

.login-form button[type="submit"],
.modal-primary {
  height: 50px;
  margin-top: 18px;
  border: 0;
  background: linear-gradient(90deg, var(--gold-dark), var(--gold-light));
  color: var(--blue);
  font: inherit;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 12px 28px rgba(181, 129, 58, 0.24);
  transition: transform 0.16s ease, filter 0.16s ease, box-shadow 0.16s ease;
}

.login-form button[type="submit"]:hover,
.modal-primary:hover {
  transform: translateY(-1px);
  filter: brightness(1.03);
  box-shadow: 0 16px 34px rgba(181, 129, 58, 0.3);
}

.login-form button:disabled {
  cursor: not-allowed;
  opacity: 0.7;
  transform: none;
}

.forgot-button {
  align-self: center;
  margin: 4px 0 0;
  padding: 8px 10px;
  border: 0;
  background: transparent;
  color: var(--gold-dark);
  font: inherit;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
}

.forgot-button:hover {
  text-decoration: underline;
}

.login-message {
  min-height: 22px;
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.45;
}

.login-message.error {
  color: var(--error);
}

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

.security-note {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.82rem;
}

.lock-icon {
  color: var(--gold-dark);
  font-size: 0.55rem;
}

.footer-note {
  margin: 24px 0 0;
  color: var(--muted);
  font-size: 0.78rem;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(10, 40, 72, 0.55);
  backdrop-filter: blur(6px);
}

.modal-backdrop[hidden] {
  display: none;
}

.modal-card {
  width: min(100%, 500px);
  position: relative;
  padding: 34px;
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.modal-card h2 {
  margin: 0 0 14px;
  color: var(--blue);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.6rem;
}

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

.modal-note {
  color: var(--ink) !important;
  font-size: 0.85rem;
}

.modal-close {
  position: absolute;
  top: 18px;
  right: 18px;
  width: 36px;
  height: 36px;
  border: 0;
  background: var(--surface-warm);
  color: var(--blue);
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
}

.recovery-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 16px;
}

.recovery-form label {
  color: var(--ink);
  font-size: 0.82rem;
  font-weight: 700;
  margin-top: 4px;
}

.recovery-form input {
  width: 100%;
  height: 48px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  font: inherit;
  padding: 0 14px;
  outline: none;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.recovery-form input:focus {
  border-color: var(--gold-dark);
  box-shadow: 0 0 0 3px rgba(181, 129, 58, 0.16);
}

.modal-actions {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 12px;
  margin-top: 10px;
}

.modal-secondary {
  height: 50px;
  margin-top: 18px;
  border: 1px solid rgba(181, 129, 58, 0.5);
  background: transparent;
  color: var(--gold-dark);
  font: inherit;
  font-weight: 800;
  cursor: pointer;
  transition: transform 0.16s ease, background 0.16s ease;
}

.modal-secondary:hover {
  transform: translateY(-1px);
  background: var(--surface-warm);
}

.modal-primary:disabled,
.modal-secondary:disabled {
  cursor: not-allowed;
  opacity: 0.7;
  transform: none;
}

@media (max-width: 980px) {
  .login-page {
    grid-template-columns: 1fr;
  }

  .login-visual {
    display: none;
  }

  .login-panel {
    padding: 28px;
  }
}

@media (max-width: 520px) {
  .login-panel {
    padding: 20px;
  }

  .login-card {
    padding: 30px 22px;
  }

  .brand-icon {
    width: 40px;
    height: 40px;
  }

  .brand-wordmark {
    height: 34px;
  }

  .brand-logo {
    max-width: 190px;
  }

  .card-heading h2 {
    font-size: 1.6rem;
  }

  .modal-actions {
    grid-template-columns: 1fr;
  }
}
