/* styles.css
   ============================================================
   1) Login moderno (etiquetas flotantes) — compartido.
   2) Panel de control / panel de usuarios.
   3) Buscador falso estilo Google.
   Responsive, pensado para móviles.
   ============================================================ */

:root {
  --brand1: #6c5ce7;   /* violeta */
  --brand2: #1a73e8;   /* azul    */
  --ink:    #1f2330;
  --muted:  #8a8f98;
  --line:   #e4e7ee;
  --danger: #e0294b;
  --ok:     #18a058;
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  color: var(--ink);
  background: #fff;
  -webkit-tap-highlight-color: transparent;
}

.hidden { display: none !important; }

/* ================= LOGIN / TARJETAS MODERNAS ================= */
.auth-bg {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 22px;
  background: linear-gradient(135deg, #eef1ff 0%, #f6f8fc 45%, #eafff5 100%);
}

.auth-card {
  width: 100%;
  max-width: 380px;
  background: #fff;
  border-radius: 22px;
  padding: 32px 26px 26px;
  box-shadow: 0 22px 55px rgba(22, 26, 45, .14);
  display: flex;
  flex-direction: column;
  gap: 16px;
  text-align: center;
}

.auth-badge {
  width: 58px;
  height: 58px;
  margin: 0 auto 2px;
  border-radius: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  background: linear-gradient(135deg, var(--brand1), var(--brand2));
  box-shadow: 0 10px 22px rgba(108, 92, 231, .35);
}

.auth-title { font-size: 22px; font-weight: 700; letter-spacing: -.2px; }
.auth-sub   { font-size: 13px; color: var(--muted); margin-top: -10px; }

/* ---- Campo con etiqueta flotante (sin texto por defecto) ---- */
.field { position: relative; text-align: left; }

.field input {
  width: 100%;
  padding: 21px 14px 7px;
  font-size: 16px;            /* 16px evita el zoom en iOS */
  color: var(--ink);
  border: 1.6px solid var(--line);
  border-radius: 13px;
  background: #fbfbfd;
  outline: none;
  transition: border-color .15s, box-shadow .15s, background .15s;
}
.field input:focus {
  border-color: var(--brand1);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(108, 92, 231, .12);
}

.field label {
  position: absolute;
  left: 15px;
  top: 15px;
  font-size: 15px;
  color: var(--muted);
  pointer-events: none;
  transition: top .15s ease, font-size .15s ease, color .15s ease;
}
/* La etiqueta sube cuando el campo está enfocado o tiene texto */
.field input:focus + label,
.field input:not(:placeholder-shown) + label {
  top: 7px;
  font-size: 11px;
  font-weight: 600;
  color: var(--brand1);
}

/* Botón mostrar/ocultar clave */
.field.has-toggle input { padding-right: 48px; }
.toggle-pass {
  position: absolute;
  right: 8px;
  top: 8px;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}
.toggle-pass:hover { background: #f1f1f6; }
.toggle-pass.on { color: var(--brand1); }

/* Botón principal */
.auth-btn {
  width: 100%;
  padding: 15px;
  margin-top: 2px;
  border: none;
  border-radius: 13px;
  font-size: 16px;
  font-weight: 600;
  color: #fff;
  cursor: pointer;
  background: linear-gradient(135deg, var(--brand1), var(--brand2));
  box-shadow: 0 10px 22px rgba(108, 92, 231, .32);
  transition: transform .08s, box-shadow .15s, opacity .15s;
}
.auth-btn:hover  { box-shadow: 0 12px 28px rgba(108, 92, 231, .42); }
.auth-btn:active { transform: translateY(1px); }
.auth-btn[disabled] { opacity: .6; cursor: default; }

.auth-error  { color: var(--danger); font-size: 13px; min-height: 16px; }
.auth-status { color: var(--ok);     font-size: 13px; min-height: 16px; }

.auth-link {
  font-size: 13px;
  color: var(--brand2);
  text-decoration: none;
  margin-top: 2px;
}
.auth-link:hover { text-decoration: underline; }

/* ================= PANEL DE USUARIOS (admin) ================= */
.admin-bg {
  min-height: 100vh;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 28px 18px;
  background: linear-gradient(135deg, #eef1ff 0%, #f6f8fc 45%, #eafff5 100%);
}

.admin-card {
  width: 100%;
  max-width: 460px;
  background: #fff;
  border-radius: 20px;
  padding: 22px;
  box-shadow: 0 22px 55px rgba(22, 26, 45, .14);
}

.admin-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}
.admin-title { font-size: 20px; font-weight: 700; }
.admin-sub   { font-size: 12px; color: var(--muted); }

.ghost-btn {
  border: 1.5px solid var(--line);
  background: #fff;
  color: var(--ink);
  border-radius: 10px;
  padding: 9px 14px;
  font-size: 14px;
  cursor: pointer;
}
.ghost-btn:hover { background: #f6f7fb; }

.add-form {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 10px;
  align-items: stretch;
}
.add-form input {
  width: 100%;
  padding: 13px 12px;
  font-size: 15px;
  border: 1.6px solid var(--line);
  border-radius: 11px;
  background: #fbfbfd;
  outline: none;
}
.add-form input:focus { border-color: var(--brand1); background: #fff; }
.add-btn { width: auto; padding: 12px 18px; margin: 0; white-space: nowrap; }

.user-list { list-style: none; margin-top: 16px; display: flex; flex-direction: column; gap: 10px; }

.user-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: #fbfbfd;
}
.user-info { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.u-name { font-weight: 600; font-size: 15px; word-break: break-all; }
.u-pass { font-size: 12px; color: var(--muted); }

.del-btn {
  border: none;
  background: #fdecef;
  color: var(--danger);
  font-weight: 600;
  font-size: 13px;
  padding: 9px 14px;
  border-radius: 10px;
  cursor: pointer;
  white-space: nowrap;
}
.del-btn:hover { background: #fbdbe1; }

.user-list .empty {
  text-align: center;
  color: var(--muted);
  font-size: 13px;
  padding: 18px 8px;
}

.hint { margin-top: 16px; font-size: 12px; color: var(--muted); text-align: center; }
.hint b { color: var(--ink); }

/* ================= BUSCADOR FALSO ESTILO GOOGLE ================= */
.google-screen {
  min-height: 100vh;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 22vh;
  background: #fff;
}

.google-inner {
  width: 100%;
  max-width: 580px;
  padding: 0 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 26px;
}

.google-logo {
  font-size: 64px;
  font-weight: 500;
  letter-spacing: -2px;
  background: linear-gradient(
    90deg,
    #4285f4 0 22%, #ea4335 22% 40%, #fbbc05 40% 58%,
    #4285f4 58% 70%, #34a853 70% 86%, #ea4335 86% 100%
  );
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.google-search {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 18px;
  border: 1px solid #dfe1e5;
  border-radius: 26px;
  box-shadow: 0 1px 6px rgba(32, 33, 36, .12);
  background: #fff;
}
.google-search:focus-within { box-shadow: 0 1px 10px rgba(32, 33, 36, .22); }
.google-search input { flex: 1; border: none; outline: none; font-size: 16px; background: transparent; }
.g-icon, .g-mic { flex: 0 0 auto; }

.google-buttons { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; }
.g-btn {
  background: #f8f9fa; border: 1px solid #f8f9fa; border-radius: 6px;
  color: #3c4043; font-size: 14px; padding: 10px 16px; cursor: pointer;
}
.g-btn:hover { border-color: #dadce0; box-shadow: 0 1px 1px rgba(0, 0, 0, .1); }

/* ================= RESPONSIVE ================= */
@media (max-width: 480px) {
  .google-logo { font-size: 52px; }
  .google-screen { padding-top: 16vh; }
  .google-buttons { width: 100%; }
  .g-btn { flex: 1; }

  .add-form { grid-template-columns: 1fr 1fr; }
  .add-btn { grid-column: 1 / -1; width: 100%; }
}
