:root {
  --forest-950: #03100d;
  --forest-850: #08231c;
  --gold-300: #f4d889;
  --gold-400: #dfb84d;
  --ivory: #f3efe4;
  --muted: #9baaa2;
  --line: rgba(231, 195, 102, .18);
  --danger: #ffad97;
}

* { box-sizing: border-box; }

html { min-height: 100%; background: var(--forest-950); }

body {
  margin: 0;
  min-height: 100svh;
  display: grid;
  place-items: center;
  padding: max(20px, env(safe-area-inset-top)) 20px max(20px, env(safe-area-inset-bottom));
  background:
    radial-gradient(circle at 50% -10%, rgba(45, 112, 83, .35), transparent 42%),
    linear-gradient(155deg, #071d17 0%, #03100d 72%);
  color: var(--ivory);
  font-family: "Manrope", "Avenir Next", sans-serif;
  -webkit-font-smoothing: antialiased;
}

.card {
  width: min(100%, 400px);
  padding: 36px 30px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(145deg, rgba(11, 44, 35, .55), rgba(3, 16, 13, .42));
  box-shadow: 0 30px 80px rgba(0, 0, 0, .35);
  animation: card-in .6s cubic-bezier(.22, .8, .28, 1) both;
}

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

.logo {
  width: 68px;
  height: auto;
  display: block;
  margin: 0 auto 8px;
  filter: drop-shadow(0 10px 24px rgba(218, 165, 55, .15));
}

.logo-circular {
  width: 132px;
  height: 132px;
  display: block;
  margin: 0 auto 22px;
  filter: drop-shadow(0 10px 26px rgba(218, 165, 55, .22));
}

h1 {
  margin: 4px 0 0;
  text-align: center;
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 26px;
  font-weight: 600;
  letter-spacing: .01em;
}

.motto {
  display: block;
  text-align: center;
  margin-top: 6px;
  color: var(--gold-300);
  font-size: 9px;
  font-weight: 500;
  letter-spacing: .26em;
  text-transform: uppercase;
}

.welcome { margin: 24px 0 20px; }

p.sub {
  text-align: center;
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.login-form { display: grid; gap: 16px; }

.field label {
  display: inline-block;
  margin-bottom: 7px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .03em;
  color: #dfe7e1;
}

.field__control {
  position: relative;
  display: flex;
  align-items: center;
  border: 1px solid rgba(220, 231, 224, .14);
  border-radius: 5px;
  background: rgba(1, 12, 9, .46);
  transition: border-color .2s ease, background .2s ease, box-shadow .2s ease;
}

.field__control:focus-within {
  border-color: rgba(228, 190, 93, .6);
  background: rgba(3, 19, 14, .74);
  box-shadow: 0 0 0 3px rgba(205, 157, 50, .08);
}

.field input {
  width: 100%;
  min-width: 0;
  padding: 13px 14px;
  border: 0;
  outline: 0;
  color: var(--ivory);
  background: transparent;
  font-size: 15px;
}

.field input::placeholder { color: #607069; }

/* Chrome/Edge autofill mete su propio fondo celeste/gris que ignora el
   "background: transparent" de arriba - esto lo neutraliza forzando el
   mismo color oscuro via box-shadow (unico truco que funciona con
   autofill) y el color de texto correcto. */
.field input:-webkit-autofill,
.field input:-webkit-autofill:hover,
.field input:-webkit-autofill:focus {
  -webkit-text-fill-color: var(--ivory);
  -webkit-box-shadow: 0 0 0 1000px rgba(3, 19, 14, .95) inset;
  box-shadow: 0 0 0 1000px rgba(3, 19, 14, .95) inset;
  caret-color: var(--ivory);
  transition: background-color 9999s ease-in-out 0s;
}

.password-toggle {
  width: 42px;
  height: 42px;
  margin-right: 2px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border: 0;
  color: #899990;
  background: transparent;
  cursor: pointer;
}

.password-toggle svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.6;
}

.password-toggle:hover { color: var(--gold-300); }
.eye-closed { display: none; }
.password-toggle[aria-pressed="true"] .eye-open { display: none; }
.password-toggle[aria-pressed="true"] .eye-closed { display: block; }

.field__error {
  display: none;
  margin-top: 6px;
  color: var(--danger);
  font-size: 10.5px;
}

.field.is-invalid .field__control { border-color: rgba(255, 145, 118, .55); }
.field.is-invalid .field__error { display: block; }

.submit-button {
  position: relative;
  overflow: hidden;
  min-height: 50px;
  margin-top: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border: 1px solid #e2bd5d;
  border-radius: 5px;
  color: #12231d;
  background: linear-gradient(100deg, #b98527, #f0d17a 48%, #c39738);
  box-shadow: 0 10px 28px rgba(184, 136, 31, .16);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  cursor: pointer;
  transition: transform .2s ease, box-shadow .2s ease, filter .2s ease;
}

.submit-button::before {
  position: absolute;
  inset: 0;
  content: "";
  background: linear-gradient(110deg, transparent 25%, rgba(255, 255, 255, .45) 48%, transparent 70%);
  transform: translateX(-130%);
  transition: transform .7s ease;
}

.submit-button:hover {
  transform: translateY(-2px);
  filter: saturate(1.1);
  box-shadow: 0 16px 36px rgba(184, 136, 31, .28);
}

.submit-button:hover::before { transform: translateX(130%); }
.submit-button:active { transform: translateY(0) scale(.97); }
.submit-button:focus-visible { outline: 2px solid #ffe29a; outline-offset: 3px; }
.submit-button:disabled { cursor: wait; }

.submit-button.is-loading::after {
  width: 14px;
  height: 14px;
  border: 2px solid rgba(18, 35, 29, .28);
  border-top-color: #12231d;
  border-radius: 50%;
  content: "";
  animation: spin .7s linear infinite;
}

.submit-button.is-loading .submit-button__label,
.submit-button.is-loading > svg { display: none; }
.submit-button__loading { display: none; }
.submit-button.is-loading .submit-button__loading { display: inline; }

@keyframes spin { to { transform: rotate(360deg); } }

.form-status {
  min-height: 16px;
  margin: 2px 0 0;
  color: var(--danger);
  font-size: 11px;
  text-align: center;
}

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