:root {
  --ink: #0a2540;
  --brand: #0b3a5c;
  --brand-mid: #1e7bb8;
  --accent: #5eb3e4;
  --surface: #f5f8fb;
  --line: rgba(10, 37, 64, 0.12);
  --muted: #5c6b7a;
  --danger: #b42318;
  --success: #0f7a45;
  --success-bg: #e8f7ef;
  --font-display: "Fraunces", Georgia, serif;
  --font-body: "Source Sans 3", "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--brand);
}

body { min-height: 100vh; }

.login-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
}

.login-brand {
  position: relative;
  overflow: hidden;
  color: #fff;
  padding: clamp(2rem, 4vw, 3.5rem);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  isolation: isolate;
  min-height: 42vh;
}

.login-brand__bg {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(160deg, rgba(11, 58, 92, 0.9) 8%, rgba(10, 37, 64, 0.75) 55%, rgba(11, 58, 92, 0.92) 100%),
    var(--auth-bg-image) center / cover no-repeat;
  z-index: -2;
  transform: scale(1.02);
  animation: brandZoom 18s ease-in-out infinite alternate;
}

.login-brand__pattern {
  position: absolute;
  inset: 0;
  z-index: -1;
  opacity: 0.28;
  background-image:
    radial-gradient(circle at 20% 20%, rgba(94, 179, 228, 0.35), transparent 40%),
    radial-gradient(circle at 80% 70%, rgba(30, 123, 184, 0.4), transparent 45%);
  pointer-events: none;
}

.login-brand__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  animation: rise 0.7s ease both;
}

.login-brand__acpe {
  height: 64px;
  width: auto;
  max-width: min(280px, 70vw);
  object-fit: contain;
  mix-blend-mode: screen;
}

.login-brand__sygep {
  height: 36px;
  width: auto;
  filter: brightness(0) invert(1);
  opacity: 0.92;
}

.login-brand__content {
  position: relative;
  z-index: 1;
  padding-top: 2rem;
}

.login-brand__mark {
  width: 52px;
  height: 52px;
  margin-bottom: 1.25rem;
  animation: rise 0.7s ease 0.05s both;
}

.login-brand h1 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(2.4rem, 5vw, 4rem);
  letter-spacing: -0.03em;
  line-height: 0.95;
  animation: rise 0.75s ease 0.1s both;
}

.login-brand h1 span {
  display: block;
  color: var(--accent);
  font-size: 0.42em;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  margin-bottom: 0.65rem;
}

.login-brand p {
  margin: 1.1rem 0 0;
  max-width: 28rem;
  font-size: 1.05rem;
  line-height: 1.55;
  color: rgba(255, 255, 255, 0.86);
  animation: rise 0.75s ease 0.18s both;
}

.login-brand__scene {
  position: absolute;
  right: -2%;
  top: 18%;
  width: min(48%, 420px);
  opacity: 0.92;
  animation: floatScene 7s ease-in-out infinite;
  pointer-events: none;
}

.login-panel {
  background: var(--surface);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(1.5rem, 4vw, 3rem);
  animation: panelIn 0.65s ease both;
}

.login-card {
  width: 100%;
  max-width: 420px;
}

.login-card__acpe {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1.5rem;
  width: fit-content;
  max-width: 100%;
  animation: rise 0.6s ease both;
}

.login-card__acpe img {
  height: 56px;
  width: auto;
  max-width: 240px;
  object-fit: contain;
  display: block;
  mix-blend-mode: multiply;
}

.login-card__eyebrow {
  margin: 0 0 0.5rem;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--brand-mid);
}

.login-card h2 {
  margin: 0 0 0.4rem;
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--ink);
}

.login-card__lead {
  margin: 0 0 1.75rem;
  color: var(--muted);
  line-height: 1.5;
}

.form-field {
  margin-bottom: 1.1rem;
}

.form-field label {
  display: block;
  margin-bottom: 0.4rem;
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--ink);
}

.form-field input[type="email"],
.form-field input[type="password"],
.form-field input[type="text"] {
  width: 100%;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 10px;
  padding: 0.85rem 1rem;
  font: inherit;
  color: var(--ink);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.form-field input:focus {
  outline: none;
  border-color: var(--brand-mid);
  box-shadow: 0 0 0 3px rgba(30, 123, 184, 0.18);
}

.form-field input:disabled {
  background: #eef3f7;
  color: var(--muted);
  cursor: not-allowed;
}

.form-hint {
  display: block;
  margin-top: 0.35rem;
  font-size: 0.82rem;
  color: var(--muted);
}

.password-row {
  display: flex;
  align-items: stretch;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  overflow: hidden;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.password-row:focus-within {
  border-color: var(--brand-mid);
  box-shadow: 0 0 0 3px rgba(30, 123, 184, 0.18);
}

.password-row input {
  border: 0 !important;
  box-shadow: none !important;
  border-radius: 0 !important;
  flex: 1;
}

.password-row button {
  border: 0;
  background: transparent;
  padding: 0 0.9rem;
  color: var(--muted);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
}

.password-row button:hover {
  color: var(--brand);
}

.form-error {
  margin-top: 0.4rem;
  font-size: 0.88rem;
  color: var(--danger);
}

.form-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin: 1.15rem 0 1.4rem;
  flex-wrap: wrap;
}

.remember {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--muted);
  font-size: 0.92rem;
}

.remember input {
  width: 1rem;
  height: 1rem;
  accent-color: var(--brand-mid);
}

.forgot,
.auth-link {
  color: var(--brand-mid);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.92rem;
}

.forgot:hover,
.auth-link:hover {
  text-decoration: underline;
}

.auth-link-row {
  margin-top: 1.25rem;
  text-align: center;
}

.btn-login {
  width: 100%;
  border: 0;
  border-radius: 10px;
  padding: 0.95rem 1.2rem;
  background: linear-gradient(135deg, var(--brand-mid), var(--brand));
  color: #fff;
  font: inherit;
  font-weight: 700;
  letter-spacing: 0.01em;
  cursor: pointer;
  transition: transform 0.15s ease, filter 0.15s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.btn-login:hover {
  filter: brightness(1.05);
  transform: translateY(-1px);
}

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

.login-foot {
  margin-top: 1.75rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.85rem;
  line-height: 1.45;
}

.login-foot strong {
  color: var(--ink);
  font-weight: 600;
}

.auth-alert {
  margin-bottom: 1.15rem;
  padding: 0.85rem 1rem;
  border-radius: 10px;
  font-size: 0.92rem;
  line-height: 1.45;
}

.auth-alert--success {
  background: var(--success-bg);
  color: var(--success);
  border: 1px solid rgba(15, 122, 69, 0.2);
}

.auth-alert--danger {
  background: #fdecea;
  color: var(--danger);
  border: 1px solid rgba(180, 35, 24, 0.18);
}

.auth-alert--warning {
  background: #fff7e8;
  color: #9a6700;
  border: 1px solid rgba(154, 103, 0, 0.22);
}

.auth-alert ul {
  margin: 0;
  padding-left: 1.1rem;
}

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

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

@keyframes brandZoom {
  from { transform: scale(1.02); }
  to { transform: scale(1.08); }
}

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

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

  .login-brand {
    min-height: 34vh;
    justify-content: flex-end;
    padding-bottom: 1.75rem;
  }

  .login-brand__scene {
    display: none;
  }

  .login-brand h1 {
    font-size: clamp(2rem, 8vw, 2.6rem);
  }

  .login-panel {
    animation: rise 0.65s ease both;
  }
}

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