/* Estilo de login copiado y adaptado de app_peritajes_practica
   (resources/views/auth/login.blade.php) para mantener la misma identidad
   visual entre ambos proyectos. */

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

:root {
  --bg: #F2F2F0;
  --surface: #FFFFFF;
  --border: rgba(0, 0, 0, .10);
  --border-md: rgba(0, 0, 0, .15);
  --text: #1A1A19;
  --text-2: #5C5C59;
  --text-3: #9A9A96;
  --accent: #0A7A5A;
  --accent-h: #086648;
  --accent-bg: #E4F4EE;
  --red: #C93030;
  --red-bg: #FDEAEA;
  --radius: 9px;
}

html {
  font-size: 14px;
}

body {
  position: relative;
  background: var(--bg);
  font-family: 'Helvetica Neue', Helvetica, Arial, system-ui, sans-serif;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 24px 24px 0;
  -webkit-font-smoothing: antialiased;
  color: var(--text);
}

/* Antes el pie de página iba con position:absolute pegado siempre a 20px del borde inferior,
   calculado sin importar el alto real de lo que hay arriba -- con poca altura de pantalla (una
   ventana angosta, o el celular en horizontal) el login-card llegaba a esa misma franja y quedaba
   todo superpuesto. Con este wrapper ocupando el espacio sobrante (flex:1) el pie queda siempre en
   flujo normal, debajo de todo lo demás -- nunca se pisan, en el peor caso aparece un scroll. */
.login-main {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
}

/* cambiar el ancho del Login */
.login-wrap {
  width: 100%;
  max-width: 375px;
}

/* Brand header */
.login-brand {
  text-align: center;
  margin-bottom: 28px;
}

.login-logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  background: var(--text);
  border-radius: 11px;
  margin-bottom: 14px;
}

.login-logo svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: #fff;
  stroke-width: 1.8;
  stroke-linecap: round;
}

.login-title {
  font-size: 19px;
  font-weight: 700;
  letter-spacing: -.02em;
  color: var(--text);
}

.login-sub {
  font-size: 12.5px;
  color: var(--text-3);
  margin-top: 3px;
}

/* Card */
.login-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 28px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, .06), 0 4px 18px rgba(0, 0, 0, .04);
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-bottom: 16px;
}

label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--text-3);
}

input[type="email"],
input[type="password"],
input[type="text"] {
  width: 100%;
  padding: 9px 12px;
  background: var(--surface);
  border: 1px solid var(--border-md);
  border-radius: var(--radius);
  font-size: 14px;
  font-family: inherit;
  color: var(--text);
  transition: border-color .12s, box-shadow .12s;
  appearance: none;
}

input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-bg);
}

.password-wrap {
  position: relative;
}

.password-wrap input {
  padding-right: 38px;
}

.toggle-password {
  position: absolute;
  top: 50%;
  right: 6px;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
  background: none;
  border: none;
  border-radius: 6px;
  color: var(--text-3);
  cursor: pointer;
}

.toggle-password:hover {
  color: var(--text-2);
  background: var(--bg);
}

.toggle-password svg {
  width: 18px;
  height: 18px;
}

.input-error {
  border-color: var(--red) !important;
}

.input-readonly {
  background: var(--bg);
  color: var(--text-3);
  cursor: default;
}

.input-readonly:focus {
  outline: none;
  border-color: var(--border-md);
  box-shadow: none;
}

.field-error {
  font-size: 11.5px;
  color: var(--red);
  margin-top: 2px;
}

.field-success {
  font-size: 12.5px;
  color: var(--accent);
  background: var(--accent-bg);
  padding: 10px 12px;
  border-radius: var(--radius);
  line-height: 1.5;
}

.forgot-link {
  font-size: 12px;
  color: var(--text-3);
  text-decoration: none;
}

.forgot-link:hover {
  color: var(--accent);
  text-decoration: underline;
}

.back-to-login {
  margin-top: 18px;
  text-align: center;
}

.back-to-login a {
  font-size: 12.5px;
  color: var(--text-3);
  text-decoration: none;
}

.back-to-login a:hover {
  color: var(--accent);
}

.check-row {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 20px;
}

.check-row input[type="checkbox"] {
  width: 14px;
  height: 14px;
  accent-color: var(--accent);
  cursor: pointer;
  flex-shrink: 0;
}

.check-row label {
  font-size: 13px;
  text-transform: none;
  letter-spacing: 0;
  color: var(--text-2);
  cursor: pointer;
  font-weight: 400;
}

.btn-submit {
  width: 100%;
  padding: 10px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  font-size: 13.5px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  transition: background .12s;
  letter-spacing: .01em;
}

.btn-submit:hover {
  background: var(--accent-h);
}

.btn-submit:active {
  transform: translateY(1px);
}

/* Demo hint */
.demo-hint {
  margin-top: 20px;
  padding: 12px 14px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 12px;
  color: var(--text-3);
  line-height: 1.75;
}

.demo-hint strong {
  color: var(--text-2);
}

.support-email {
  font-size: 11px;
  white-space: nowrap;
}

/* Solo achica el recuadro y la letra del mail en pantallas de celular real
   (no toca nada en la web, donde ya entra bien con el tamaño normal). */
@media (max-width: 480px) {
  .demo-hint {
    padding: 12px 10px;
  }

  .support-email {
    font-size: 10px;
  }
}

.app-footer {
  width: 100%;
  text-align: center;
  font-size: 11px;
  color: var(--text-3);
  /* var(--inset-bottom) lo inyecta NativePHP con el alto real de la barra de navegación del
     sistema -- en la web (sin inyección) el fallback 0px no cambia nada. */
  padding: 20px 24px calc(var(--inset-bottom, 0px) + 20px);
}

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