:root {
  color-scheme: light;
  --white: #ffffff;
  --paper: #f7f6f3;
  --ink: #172538;
  --muted: #71808d;
  --line: #dfe3e6;
  --soft-line: #edf0f1;
  --coral: #c16653;
  --coral-dark: #ae5747;
  --green: #4d956b;
  --focus: rgba(193, 102, 83, 0.22);
  --sans: "Avenir Next", "Segoe UI", sans-serif;
  --serif: Georgia, "Times New Roman", serif;
}

* {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  min-width: 320px;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
}

button,
input {
  font: inherit;
}

button {
  border-radius: 0;
}

.login-page {
  position: relative;
  isolation: isolate;
  display: flex;
  min-height: 100svh;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: clamp(32px, 6vh, 64px) 24px;
  background:
    linear-gradient(90deg, transparent 0 50%, rgba(23, 37, 56, 0.018) 50%, transparent 50.1%),
    var(--paper);
}

.login-backdrop {
  position: absolute;
  z-index: -1;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.login-trajectory {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  opacity: 0.9;
}

.login-trajectory path {
  fill: none;
  stroke-linecap: round;
  vector-effect: non-scaling-stroke;
}

.login-trajectory__base {
  stroke: rgba(23, 37, 56, 0.13);
  stroke-width: 1.2;
}

.login-trajectory__runner {
  stroke: #7f1d35;
  stroke-width: 3.2;
  stroke-dasharray: 310 1130;
  stroke-dashoffset: 1440;
  opacity: 0.76;
  filter: drop-shadow(0 0 9px rgba(127, 29, 53, 0.38));
  animation: login-trajectory-run 9.5s linear infinite;
}

.login-trajectory__spark {
  fill: #7f1d35;
  filter: drop-shadow(0 0 8px rgba(127, 29, 53, 0.68));
}

.login-frame {
  width: min(430px, 100%);
}

.login-brand-pair {
  position: absolute;
  z-index: 1;
  top: clamp(24px, 5vh, 46px);
  right: clamp(22px, 5vw, 64px);
  display: flex;
  width: max-content;
  height: auto;
  align-items: flex-start;
  gap: 0;
}

.login-brand-center {
  position: relative;
  z-index: 1;
  display: flex;
  width: min(330px, calc(100vw - 40px));
  height: 58px;
  align-items: center;
  justify-content: center;
  margin: 0 auto clamp(18px, 4vh, 28px);
}

.login-brand-logo--center {
  position: static;
  display: block;
  width: 100%;
  height: 100%;
  max-width: none;
  background: #7f1d35;
  -webkit-mask: url("img/demostenes-torres-logo.png") center / contain no-repeat;
  mask: url("img/demostenes-torres-logo.png") center / contain no-repeat;
  transform: none;
}

.login-logo {
  display: block;
  position: relative;
  width: clamp(78px, 8vw, 96px);
  height: auto;
  object-fit: contain;
  object-position: center;
  margin: 0;
}

.login-box {
  width: 100%;
  padding: clamp(28px, 4vw, 38px);
  border: 1px solid var(--line);
  border-top: 3px solid #7f1d35;
  background: var(--white);
  box-shadow: 0 18px 42px rgba(23, 37, 56, 0.07);
}

.feedback {
  margin: 0 0 24px;
  padding: 11px 13px;
  border-left: 2px solid var(--coral-dark);
  background: #fff7f4;
  color: #7e4338;
  font-size: 12px;
  line-height: 1.45;
}

.field {
  margin-bottom: 22px;
}

.field label {
  display: block;
  margin: 0 0 10px;
  color: var(--ink);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.18em;
  line-height: 1.2;
  text-transform: uppercase;
}

.field input {
  display: block;
  width: 100%;
  height: 50px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 0;
  outline: 0;
  background: var(--white);
  color: var(--ink);
  font-size: 15px;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

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

.field input:focus {
  border-color: var(--coral);
  box-shadow: 0 0 0 3px var(--focus);
}

.field input[aria-invalid="true"] {
  border-color: var(--coral-dark);
}

.field-error {
  margin: 8px 0 0;
  color: var(--coral-dark);
  font-size: 11px;
  line-height: 1.4;
}

.submit-button,
.certificate-button {
  display: flex;
  width: 100%;
  min-height: 51px;
  align-items: center;
  justify-content: center;
  border: 1px solid #7f1d35;
  background: #7f1d35;
  color: var(--white);
  cursor: pointer;
  font-size: 14px;
  transition: background 160ms ease, border-color 160ms ease;
}

.submit-button:hover,
.submit-button:focus-visible {
  border-color: var(--coral-dark);
  background: var(--coral-dark);
}

.submit-button:focus-visible,
.certificate-button:focus-visible {
  outline: 0;
  box-shadow: 0 0 0 3px var(--focus);
}

.location-note {
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.45;
  text-align: center;
}

.location-note.is-pending {
  color: var(--coral-dark);
}

.location-note.is-unavailable {
  color: var(--muted);
}

.security-note {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 17px 0 0;
  color: var(--ink);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.14em;
  line-height: 1.3;
  text-transform: uppercase;
}

.security-note span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 3px rgba(77, 149, 107, 0.12);
}

.certificate-login {
  margin-top: 29px;
}

.certificate-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
  color: #87929d;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.18em;
  line-height: 1;
  text-transform: uppercase;
}

.certificate-divider::before,
.certificate-divider::after {
  height: 1px;
  flex: 1;
  content: "";
  background: var(--line);
}

.certificate-button {
  min-height: 46px;
  justify-content: space-between;
  padding: 0 17px;
  border-color: var(--line);
  background: var(--white);
  color: #8b98a4;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-align: left;
  text-transform: uppercase;
}

.certificate-button:not(:disabled):hover,
.certificate-button:not(:disabled):focus-visible {
  border-color: var(--coral);
  color: var(--coral-dark);
}

.certificate-button:disabled {
  cursor: not-allowed;
  opacity: 0.72;
}

@media (max-width: 480px) {
  .login-page {
    padding: 30px 20px;
  }

  .login-box {
    padding: 27px 22px 24px;
  }

  .login-brand-pair {
    top: 22px;
    right: 20px;
  }

  .login-brand-center {
    width: min(330px, calc(100vw - 40px));
    height: 52px;
    margin-bottom: 18px;
  }

  .login-logo {
    width: 84px;
    height: auto;
  }

  .login-trajectory {
    opacity: 0.72;
  }
}

@keyframes login-trajectory-run {
  from {
    stroke-dashoffset: 1440;
  }
  to {
    stroke-dashoffset: -1440;
  }
}

@media (prefers-reduced-motion: reduce) {
  .login-trajectory__runner,
  .login-trajectory__spark {
    animation: none;
    stroke-dasharray: none;
    stroke-dashoffset: 0;
    opacity: 0.24;
  }

  .login-trajectory__spark {
    display: none;
  }
}
