/* Admin Auth (Login) Modern Responsive Theme */
:root {
  --bg: #f6f7fb;
  --surface: rgba(255,255,255,.78);
  --border: rgba(15, 23, 42, .12);
  --text: #0b1220;
  --muted: rgba(15, 23, 42, .62);
  --primary: #155cba;
  --primary-600: #0f4ea4;
  --accent: #0ea5e9;
  --danger: #b91c1c;
  --radius: 16px;
  --shadow: 0 20px 55px rgba(2, 6, 23, .18);
  --ring: 0 0 0 4px rgba(21, 92, 186, .16);
}

/* Touch and tap optimizations */
.btn-login, .eye-toggle { -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
.form-group input { line-height: 1.2; }
html, body { overflow-x: hidden; }

/* Base */
*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; width: 100%; }
body.auth {
  margin: 0;
  min-height: 100vh;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Cantarell, Noto Sans, "Helvetica Neue", Arial, "Apple Color Emoji", "Segoe UI Emoji";
  color: var(--text);
  overflow-x: hidden;
  background: var(--bg);
  position: relative;
}

body.auth::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(180deg, rgba(255,255,255,.78) 0%, rgba(255,255,255,.86) 55%, rgba(255,255,255,.92) 100%),
    url("../img/portada.png");
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  filter: saturate(1.05) contrast(1.02);
  z-index: 0;
}

body.auth::after {
  content: "";
  position: fixed;
  inset: 0;
  background:
    radial-gradient(900px 520px at 20% 15%, rgba(14,165,233,.18) 0%, rgba(14,165,233,0) 60%),
    radial-gradient(900px 520px at 85% 25%, rgba(21,92,186,.16) 0%, rgba(21,92,186,0) 62%),
    radial-gradient(1100px 720px at 45% 110%, rgba(2,6,23,.10) 0%, rgba(2,6,23,0) 60%);
  z-index: 0;
}

.auth-wrapper { display: grid; place-items: center; min-height: 100vh; padding: 24px; position: relative; z-index: 1; }
@supports (height: 100svh) { .auth-wrapper { min-height: 100svh; } }
@supports (height: 100dvh) { .auth-wrapper { min-height: 100dvh; } }

.auth-card {
  width: min(94vw, 440px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  backdrop-filter: blur(14px);
  box-shadow: var(--shadow);
  padding: 26px 22px 22px;
}

.brand { display: flex; align-items: center; gap: 12px; font-weight: 850; letter-spacing: .4px; color: var(--text); }
.brand .logo-dot { width: 12px; height: 12px; border-radius: 999px; background: radial-gradient(circle at 30% 30%, #7dd3fc 0%, var(--accent) 35%, var(--primary) 100%); box-shadow: 0 10px 30px rgba(14,165,233,.28); }

.auth-card h2 { margin: 14px 0 18px; font-weight: 800; }

.form-group { margin-bottom: 14px; }
.form-group label { display: block; margin-bottom: 8px; color: var(--muted); font-size: .95rem; }
.form-group input { width: 100%; padding: 12px 14px; color: var(--text); background: rgba(255,255,255,.92); border: 1px solid var(--border); border-radius: 12px; outline: none; transition: border-color .2s, box-shadow .2s, background-color .2s; font-size: 1rem; }
.form-group input::placeholder { color: rgba(15,23,42,.38); }
.form-group input:focus { border-color: rgba(21, 92, 186, .55); box-shadow: var(--ring); background: #ffffff; }

.password-field { position: relative; }
.input-with-eye { position: relative; }
.password-field input { height: 48px; padding-right: 56px; display: block; width: 100%; }
.eye-toggle { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); display: grid; place-items: center; width: 48px; height: 48px; border-radius: 12px; border: 1px solid var(--border); background: rgba(255,255,255,.92); color: rgba(15,23,42,.78); cursor: pointer; transition: background-color .2s, border-color .2s, box-shadow .2s; }
.eye-toggle:hover { background: #ffffff; border-color: rgba(21,92,186,.35); box-shadow: 0 8px 18px rgba(2,6,23,.08); }
.eye-toggle svg { width: 20px; height: 20px; }

.btn-login { width: 100%; appearance: none; border: 1px solid rgba(21,92,186,.18); background: linear-gradient(90deg, var(--primary) 0%, var(--primary-600) 60%, #0b3d91 100%); color: white; border-radius: 12px; padding: 12px 16px; cursor: pointer; font-weight: 850; letter-spacing: .3px; margin-top: 8px; box-shadow: 0 14px 30px rgba(21,92,186,.22); transition: transform .15s ease, filter .15s ease, box-shadow .15s ease; }
.btn-login:hover { filter: brightness(1.03); box-shadow: 0 16px 36px rgba(21,92,186,.26); }
.btn-login:active { transform: translateY(1px); }

.foot { margin-top: 16px; display: flex; justify-content: space-between; align-items: center; }
.back-link { color: var(--muted); text-decoration: none; font-size: .95rem; }
.back-link:hover { color: var(--text); text-decoration: underline; }

/* Error helper text (fallback if not using SweetAlert) */
.error-inline { color: #991b1b; font-size: .9rem; margin-top: 8px; display: none; }

/* Responsive tweaks */
@media (max-width: 420px) { .auth-card { padding: 22px 16px 16px; } }

/* Safe-area support (iOS notch) */
.auth-wrapper {
  padding-top: calc(24px + env(safe-area-inset-top));
  padding-bottom: calc(24px + env(safe-area-inset-bottom));
}

/* Mobile enhancements */
@media (max-width: 768px) {
  body.auth { background-attachment: scroll; }
  .auth-card { width: min(94vw, 420px); padding: 22px 16px 16px; border-radius: 12px; }
  .brand { font-size: 1rem; }
  .form-group input { font-size: 16px; }
}

@media (max-width: 420px) {
  .brand { font-size: .95rem; }
  .auth-card h2 { font-size: 1.25rem; }
  .btn-login { padding: 12px 14px; font-size: 1rem; }
}

@media (max-width: 360px) {
  .auth-card { padding: 18px 12px; }
  .form-group label { font-size: .9rem; }
}
