/* =====================================================================
   ADMIN RETO MARTIDERM - Acceso (noviembre 2026)
   El mismo acceso que retomartiderm.es: tarjeta centrada sobre la red de puntos.
   Solo presentacion. Verde corporativo: #0d7e6a
   ===================================================================== */

@font-face {
  font-family: "Lato Martiderm";
  src: url("../fonts/lato/lato-regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Lato Martiderm";
  src: url("../fonts/lato/lato-bold.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

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

:root {
  --md-green: #0d7e6a;
  --md-green-light: #1d9a80;
  --md-green-dark: #0a6455;
  --md-green-deep: #06463b;
  --md-ink: #17332d;
  --md-muted: #5f736d;
  --md-line: #d3e3dc;
  --md-field: #f3f8f6;
  --md-font: "Lato Martiderm", "Titillium Web", Arial, sans-serif;
}

html {
  background: #e9f3ee;
  height: auto;
}

body {
  background:
    url("../img/fondo-red.svg") center / cover no-repeat,
    radial-gradient(ellipse at 50% 42%, #f7fbf9 0, #ebf4f0 55%, #deede6 100%);
  background-attachment: fixed;
  color: var(--md-ink);
  font-family: var(--md-font);
  font-size: 16px;
  height: auto;
  margin: 0;
  min-height: 100vh;
}

body > .hidden {
  display: none;
}

.md-login {
  align-items: center;
  box-sizing: border-box;
  display: flex;
  justify-content: center;
  min-height: 100vh;
  padding: 40px 16px;
  position: relative;
  z-index: 1;
}

/* Red animada (js/fondo-red.js); sustituye a la red fija del fondo */
.md-red {
  display: block;
  height: 100%;
  left: 0;
  pointer-events: none;
  position: fixed;
  top: 0;
  width: 100%;
  z-index: 0;
}

html.md-red-activa body {
  background: radial-gradient(ellipse at 50% 42%, #f7fbf9 0, #ebf4f0 55%, #deede6 100%);
  background-attachment: fixed;
}

/* Tarjeta */
.md-login-card {
  background: #fff;
  border: 1px solid rgba(13, 126, 106, .12);
  border-radius: 22px;
  box-shadow: 0 46px 80px -40px rgba(6, 70, 59, .55), 0 18px 36px -24px rgba(6, 70, 59, .22);
  max-width: 520px;
  overflow: hidden;
  position: relative;
  width: 100%;
}

.md-login-card:before {
  background: linear-gradient(90deg, var(--md-green-light), var(--md-green) 50%, var(--md-green-deep));
  content: "";
  height: 6px;
  left: 0;
  position: absolute;
  right: 0;
  top: 0;
}

.md-login-body {
  padding: 52px 48px 40px;
}

.md-login-logo {
  border-radius: 4px;
  display: block;
  height: auto;
  margin: 0 auto 22px;
  width: 128px;
}

/* sin margenes de navegador (sin peso: las reglas de abajo mandan) */
:where(.md-login) :where(h1, p) {
  margin: 0;
}

.md-login-title {
  color: var(--md-ink);
  font-family: var(--md-font);
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -.01em;
  line-height: 1.2;
  margin: 0;
  text-align: center;
}

.md-login-sub {
  color: var(--md-muted);
  font-size: 15px;
  margin: 8px 0 30px;
  text-align: center;
}

/* Campos */
.md-field {
  margin-bottom: 18px;
}

.md-field label {
  color: var(--md-muted);
  display: block;
  font-size: 14px;
  font-weight: 700;
  margin: 0 0 7px;
}

.md-input {
  position: relative;
}

.md-input > .fa:first-child {
  color: var(--md-green);
  font-size: 16px;
  left: 16px;
  pointer-events: none;
  position: absolute;
  text-align: center;
  top: 50%;
  transform: translateY(-50%);
  width: 20px;
  z-index: 2;
}

.md-login .form-control {
  -webkit-appearance: none;
  appearance: none;
  display: block;
  line-height: 1.5;
  margin: 0;
  width: 100%;
  background: var(--md-field);
  border: 1px solid var(--md-line);
  border-radius: 12px;
  box-shadow: none;
  color: var(--md-ink);
  font-family: var(--md-font);
  font-size: 16px;
  height: 56px;
  padding: 0 16px 0 46px;
  transition: border-color .2s ease, box-shadow .2s ease, background-color .2s ease;
}

.md-login .form-control.password {
  padding-right: 54px;
}

.md-login .form-control::placeholder {
  color: #8a9c96;
  opacity: 1;
}

.md-login .form-control:focus {
  background: #fff;
  border-color: var(--md-green);
  box-shadow: 0 0 0 4px rgba(13, 126, 106, .14);
  outline: 0;
}

/* Ojito para ver la clave */
.md-login .pwd-toggle {
  border-radius: 10px;
  color: var(--md-muted);
  cursor: pointer;
  font-size: 19px;
  height: 44px;
  line-height: 44px;
  position: absolute;
  right: 4px;
  text-align: center;
  top: 4px;
  user-select: none;
  width: 44px;
  z-index: 2;
}

.md-login .pwd-toggle:hover {
  color: var(--md-green);
}

.md-login .pwd-toggle:focus-visible {
  outline: 3px solid rgba(13, 126, 106, .45);
}

/* Evita el segundo ojito que anade Edge */
.md-login input::-ms-reveal,
.md-login input::-ms-clear {
  display: none;
}

/* Datos recordados por el navegador: sin el fondo azul */
.md-login .form-control:-webkit-autofill,
.md-login .form-control:-webkit-autofill:hover {
  -webkit-box-shadow: 0 0 0 60px #eef6f2 inset;
  -webkit-text-fill-color: var(--md-ink);
  caret-color: var(--md-ink);
}

.md-login .form-control:-webkit-autofill:focus {
  -webkit-box-shadow: 0 0 0 60px #eef6f2 inset, 0 0 0 4px rgba(13, 126, 106, .14);
  -webkit-text-fill-color: var(--md-ink);
  caret-color: var(--md-ink);
}

.md-login .form-control:-webkit-autofill::first-line {
  font-family: var(--md-font);
  font-size: 16px;
}

/* Boton */
.md-login-btn {
  background: linear-gradient(100deg, var(--md-green-light) 0, var(--md-green) 45%, var(--md-green-deep) 100%);
  border: 0;
  border-radius: 12px;
  box-shadow: 0 18px 30px -16px rgba(6, 70, 59, .75);
  color: #fff;
  cursor: pointer;
  display: block;
  font-family: var(--md-font);
  font-size: 16px;
  font-weight: 700;
  height: 58px;
  letter-spacing: .08em;
  margin-top: 28px;
  text-transform: uppercase;
  transition: filter .2s ease, transform .2s ease, box-shadow .2s ease;
  width: 100%;
}

.md-login-btn:hover {
  box-shadow: 0 22px 34px -16px rgba(6, 70, 59, .8);
  filter: brightness(1.07);
  transform: translateY(-1px);
}

.md-login-btn:active {
  filter: brightness(.97);
  transform: none;
}

.md-login-btn:focus {
  outline: 0;
}

.md-login-btn:focus-visible {
  outline: 3px solid rgba(13, 126, 106, .4);
  outline-offset: 3px;
}

/* Pie de la tarjeta: contacto para incidencias */
.md-login-footer {
  background: #f1f7f4;
  border-top: 1px solid #e0ece6;
  color: var(--md-muted);
  font-size: 14px;
  line-height: 1.5;
  padding: 18px 24px 20px;
  text-align: center;
}

.md-login-contact {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 22px;
  justify-content: center;
  margin-top: 6px;
}

.md-login-contact a {
  color: var(--md-green-dark);
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
}

.md-login-contact a:hover,
.md-login-contact a:focus {
  color: var(--md-green-deep);
  text-decoration: underline;
}

.md-login-contact .fa {
  margin-right: 6px;
}

/* Aviso de Bloq Mayus */
.md-aviso-mayus {
  align-items: center;
  background: #fff4d6;
  border: 1px solid #ecc56a;
  border-radius: 10px;
  color: #6b4a00;
  display: flex;
  font-size: 14px;
  font-weight: 700;
  gap: 8px;
  line-height: 1.3;
  margin: 8px 0 0;
  padding: 8px 12px;
}

.md-aviso-mayus[hidden] {
  display: none;
}

.md-aviso-mayus .fa {
  color: #b7791f;
}

/* Aviso de datos incorrectos */
.md-login-error {
  align-items: center;
  background: #fbe7e4;
  border: 1px solid #efb7ae;
  border-radius: 12px;
  color: #8f2a21;
  display: flex;
  font-size: 15px;
  font-weight: 700;
  gap: 10px;
  line-height: 1.35;
  margin: -12px 0 22px;
  padding: 12px 14px;
}

.md-login-error .fa {
  color: #b5342a;
  font-size: 17px;
}

/* Boton mientras entra */
.md-login-btn.is-cargando,
.md-login-btn:disabled {
  box-shadow: 0 18px 30px -16px rgba(6, 70, 59, .75);
  cursor: progress;
  filter: none;
  opacity: .94;
  transform: none;
}

.md-spinner {
  animation: md-giro .75s linear infinite;
  border: 2px solid rgba(255, 255, 255, .35);
  border-radius: 50%;
  border-top-color: #fff;
  display: inline-block;
  height: 18px;
  margin-right: 10px;
  vertical-align: -3px;
  width: 18px;
}

@keyframes md-giro {
  to {
    transform: rotate(360deg);
  }
}

@media (max-width: 480px) {
  .md-login {
    align-items: flex-start;
    padding: 24px 14px;
  }

  .md-login-body {
    padding: 36px 22px 28px;
  }

  .md-login-logo {
    margin-bottom: 18px;
    width: 96px;
  }

  .md-login-title {
    font-size: 23px;
  }

  .md-login-sub {
    margin-bottom: 24px;
  }

  .md-login-footer {
    padding: 16px 18px 18px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .md-login-btn,
  .md-login .form-control {
    transition: none;
  }

  .md-spinner {
    animation-duration: 1.6s;
  }

  .md-login-btn:hover {
    transform: none;
  }
}
