/* login.css */

/* FIX: forzamos light en toda la página para evitar que el navegador móvil
   aplique color-scheme dark al card y sus inputs (texto blanco invisible). */
:root {
  color-scheme: light;
}

body {
  margin: 0;
  background-image: url("../fondo.webp");
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  display: grid;
  place-items: center;
  min-height: 100svh;
  padding: 16px;
  background-color: #09222d;
}

body::before {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(9, 34, 45, 0.7);
  z-index: 0;
}

.card {
  width: min(420px, 90%);
  border: 1px solid rgba(127, 127, 127, 0.35);
  border-radius: 14px;
  padding: 16px;
  background: #dce0df;
  position: relative;
  z-index: 1;
}

.card:hover {
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

h1 {
  margin: 0 0 12px;
  font-size: 24px;
  color: black;
}

label {
  display: block;
  margin: 10px 0 6px;
  font-size: 19px;
  color: #000;
}

/* FIX: fondo y color de texto explícitos — evita que el dark mode del sistema
   herede un fondo negro y texto blanco en los inputs de móvil */
input {
  width: 100%;
  padding: 10px;
  border-radius: 10px;
  border: 1px solid rgba(127, 127, 127, 0.35);
  background: #ffffff;
  color: #111111;
  color-scheme: light;
  box-sizing: border-box;
  font-size: 16px; /* Evita el auto-zoom en iOS */
  font-family: inherit;
}

input::placeholder {
  color: #888;
}

/* ── Wrapper input + botón ojo ── */
.input-wrapper {
  position: relative;
  display: block;
}

.input-wrapper input {
  padding-right: 44px;
}

.btn-eye {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  background: transparent;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  color: #555;
  padding: 0;
  margin: 0;
  min-width: 0;
}

.btn-eye:hover {
  color: #000;
  background: rgba(0, 0, 0, 0.07);
}

.btn-eye svg {
  width: 20px;
  height: 20px;
  pointer-events: none;
  display: block;
}

/* ── Banner informativo de bienvenida ── */
.welcome-banner {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 0 0 14px;
  padding: 13px 12px;
  border-radius: 12px;
  border: 1px solid rgba(21, 132, 63, 0.3);
  background: linear-gradient(
    160deg,
    rgba(21, 132, 63, 0.13),
    rgba(21, 132, 63, 0.05)
  );
}

.welcome-banner__icon {
  font-size: 20px;
  flex: 0 0 auto;
  line-height: 1.2;
}

.welcome-banner__body {
  flex: 1;
  min-width: 0;
}

.welcome-banner__title {
  margin: 0 0 3px;
  font-size: 13.5px;
  font-weight: 700;
  color: #0a4a22;
  line-height: 1.3;
}

.welcome-banner__text {
  margin: 0;
  font-size: 12.5px;
  color: #1a5c30;
  line-height: 1.5;
}

.welcome-banner__close {
  flex: 0 0 auto;
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  background: transparent;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 16px;
  color: #555;
  padding: 0;
  margin: 0;
  min-width: 0;
  line-height: 1;
}

.welcome-banner__close:hover {
  background: rgba(0, 0, 0, 0.08);
  color: #000;
}

.welcome-banner[hidden] {
  display: none !important;
}

/* ── Botones principales ── */
button {
  width: 100%;
  margin-top: 12px;
  padding: 10px;
  border-radius: 10px;
  border: 1px solid rgba(127, 127, 127, 0.35);
  background: #0c3a3e;
  color: white;
  cursor: pointer;
  font-size: 15px;
  font-family: inherit;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* Spinner animado dentro del botón */
.btn-spinner {
  width: 15px;
  height: 15px;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: login-spin 0.65s linear infinite;
  flex-shrink: 0;
}

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

.tabs {
  display: flex;
  gap: 8px;
  margin: 10px 0 6px;
}

.tab {
  flex: 1;
  margin-top: 0;
  padding: 8px;
}

.tab.is-active {
  outline: 2px solid rgba(127, 127, 127, 0.55);
}

.status {
  margin: 12px 0 0;
  font-size: 14px;
}

.hint {
  margin: 10px 0 0;
  font-size: 13px;
  opacity: 0.8;
}

@media (max-width: 600px) {
  body {
    font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
    display: grid;
    place-items: center;
    margin: 0;
    padding: 0;
    min-height: 100vh;
    width: 100vw;
    background-image: url("../fondo.webp");
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed;
  }

  .card {
    padding: 14px;
  }
}
