/* Cuentas: botón de la barra superior, página de acceso e histórico (sobre /ui/styles.css) */

/* ---------- Botón de cuenta en la barra superior ---------- */
.acc-login {
  height: 38px; display: inline-flex; align-items: center; padding: 0 16px; border-radius: 12px;
  border: 1px solid var(--line); background: var(--card); color: var(--text); box-shadow: var(--shadow-sm);
  font-size: 14px; font-weight: 600; text-decoration: none; white-space: nowrap;
  transition: transform .25s var(--ease), box-shadow .25s, background .25s;
}
.acc-login:hover { transform: translateY(-1px); box-shadow: var(--shadow); background: var(--surface); }
.acc { position: relative; }
.acc-btn {
  width: 38px; height: 38px; padding: 0; border-radius: 50%; overflow: hidden; display: grid; place-items: center;
  border: 2px solid var(--surface); background: var(--navy); color: #FFFFFF; font-size: 15px; font-weight: 700;
  box-shadow: var(--shadow-sm), 0 0 0 1px var(--line); transition: transform .3s var(--spring), box-shadow .25s;
}
.acc-btn:hover, .acc.open .acc-btn { transform: scale(1.06); box-shadow: var(--shadow), var(--glow-green); }
.acc-btn img { width: 100%; height: 100%; object-fit: cover; display: block; }
.acc-menu {
  position: absolute; right: 0; top: calc(100% + 10px); z-index: 80; min-width: 250px; max-width: 320px; padding: 6px;
  background: var(--drawer); backdrop-filter: blur(20px); border-radius: 16px; box-shadow: var(--shadow-lg), 0 0 0 1px var(--line);
  opacity: 0; transform: translateY(-6px) scale(.98); transform-origin: top right; pointer-events: none;
  transition: opacity .2s, transform .3s var(--spring);
}
.acc.open .acc-menu { opacity: 1; transform: none; pointer-events: auto; }
.acc-who { padding: 10px 12px 12px; margin-bottom: 4px; border-bottom: 1px solid var(--line); min-width: 0; }
.acc-who b { display: block; font-size: 14.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acc-who small { display: block; font-size: 12.5px; color: var(--text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acc-menu a, .acc-menu button {
  display: block; width: 100%; padding: 10px 12px; border: 0; border-radius: 10px; background: none; text-align: left;
  font-size: 14px; font-weight: 500; color: var(--text); text-decoration: none; transition: background .2s;
}
.acc-menu a:hover, .acc-menu button:hover { background: var(--field); }
.acc-menu .acc-logout { color: var(--red); }

/* Aviso para guardar el historial (panel lateral de la app) */
.recent-foot { margin-top: 10px; font-size: 13px; color: var(--text-3); line-height: 1.45; }
.recent-foot a { color: var(--green-2); font-weight: 600; text-decoration: none; }
.recent-foot a:hover { text-decoration: underline; }
.side-head a { font-size: 13.5px; font-weight: 600; color: var(--green-2); text-decoration: none; }

/* ---------- Página de acceso ---------- */
.auth-main { min-height: calc(100vh - 90px); display: grid; place-items: center; padding: 20px 20px 60px; }
.auth-card { width: min(440px, 100%); padding: 30px 30px 26px; }
.auth-card h1 { font-size: 26px; font-weight: 700; letter-spacing: -.02em; }
.auth-card .lead { font-size: 14.5px; margin-top: 6px; }
.auth-tabs { position: relative; display: flex; margin: 22px 0 18px; padding: 4px; border-radius: 13px; background: var(--field); border: 1px solid var(--line); }
.auth-tabs button { flex: 1; position: relative; z-index: 1; height: 38px; border: 0; border-radius: 10px; background: none; font-size: 14px; font-weight: 600; color: var(--text-2); transition: color .3s; }
.auth-tabs button.on { color: #FFFFFF; }
.auth-tabs .seg-thumb { top: 4px; bottom: 4px; }
.google-btn {
  width: 100%; height: 46px; display: flex; align-items: center; justify-content: center; gap: 10px;
  border-radius: 13px; border: 1px solid var(--line-2); background: var(--surface); color: var(--text);
  font-size: 14.5px; font-weight: 600; transition: transform .25s var(--ease), box-shadow .25s;
}
.google-btn:hover { transform: translateY(-1px); box-shadow: var(--shadow); }
.google-btn svg { width: 19px; height: 19px; stroke: none; }
.auth-or { display: flex; align-items: center; gap: 12px; margin: 16px 0; font-size: 12.5px; color: var(--text-3); }
.auth-or::before, .auth-or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.auth-form { display: flex; flex-direction: column; gap: 12px; }
.auth-form label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 600; color: var(--text-2); }
.auth-form input {
  height: 46px; padding: 0 14px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--field);
  font: 500 15px "Figtree", sans-serif; color: var(--text); outline: 0; transition: border-color .25s, box-shadow .25s, background .25s;
}
.auth-form input:focus { border-color: var(--green); box-shadow: var(--glow-green); background: var(--surface); }
.auth-form .cta { width: 100%; min-width: 0; height: 48px; margin-top: 4px; }

/* Contraseña: se ve solo mientras se mantiene pulsado el ojo */
.pw-field { position: relative; display: block; }
.pw-field input { width: 100%; padding-right: 50px; }
.pw-eye {
  position: absolute; top: 50%; right: 5px; transform: translateY(-50%); width: 38px; height: 38px; padding: 0;
  display: grid; place-items: center; border: 0; border-radius: 10px; background: none; color: var(--text-3);
  cursor: pointer; touch-action: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none;
  transition: color .2s, background .2s;
}
.pw-eye:hover { color: var(--text); background: var(--surface); }
.pw-eye:focus-visible { outline: 2px solid var(--green); outline-offset: -2px; }
.pw-eye svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; pointer-events: none; }
.pw-eye .eye-off { display: none; }
.pw-eye.on { color: var(--green-2); }
.pw-eye.on .eye-on { display: none; }
.pw-eye.on .eye-off { display: block; }

/* Requisitos de la contraseña al crear la cuenta o cambiarla */
.pw-rules { list-style: none; margin: -2px 0 2px; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 5px 12px; }
.pw-rules li { display: flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--text-3); transition: color .2s; }
.pw-rules li i {
  width: 16px; height: 16px; flex: none; display: grid; place-items: center; border-radius: 50%;
  border: 1.5px solid var(--line-2); transition: background .2s, border-color .2s;
}
.pw-rules li i svg { width: 10px; height: 10px; fill: none; stroke: #FFFFFF; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; opacity: 0; transition: opacity .2s; }
.pw-rules li.ok { color: var(--green-2); }
.pw-rules li.ok i { background: var(--green); border-color: var(--green); }
.pw-rules li.ok i svg { opacity: 1; }
.pw-rules.check li:not(.ok) { color: var(--red); }
.pw-rules.check li:not(.ok) i { border-color: var(--red); }
@media (max-width: 400px) { .pw-rules { grid-template-columns: 1fr; } }
.auth-row { display: flex; justify-content: flex-end; margin-top: -4px; }
.auth-msg { display: none; padding: 11px 13px; border-radius: 12px; font-size: 13.5px; line-height: 1.45; }
.auth-msg.show { display: block; animation: note .35s var(--ease); }
.auth-msg.err { background: var(--red-soft); color: var(--red); }
.auth-msg.ok { background: var(--green-soft); color: var(--green-2); }
.auth-legal { margin-top: 18px; font-size: 12.5px; color: var(--text-3); text-align: center; line-height: 1.5; }
.auth-legal a { color: var(--text-2); }
[hidden] { display: none !important; }

/* ---------- Histórico ---------- */
.hist-main { max-width: 980px; margin: 0 auto; padding: 18px 24px 60px; }
.hist-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin: 8px 0 20px; }
.hist-head h1 { font-size: 30px; font-weight: 700; letter-spacing: -.02em; }
.hist-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.hist-item { padding: 18px 20px; display: grid; grid-template-columns: 64px minmax(0, 1fr) auto; gap: 16px; align-items: center; animation: rise .5s var(--ease) both; }
.hist-thumb { width: 64px; aspect-ratio: 16 / 9; border-radius: 8px; overflow: hidden; background: var(--navy-soft); }
.hist-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.hist-title { font-size: 15.5px; font-weight: 700; line-height: 1.3; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.hist-meta { margin-top: 3px; font-size: 12.5px; color: var(--text-3); }
.hist-headline { margin-top: 7px; font-size: 13.5px; color: var(--text-2); line-height: 1.45; }
.hist-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.hist-tags span { height: 24px; display: inline-flex; align-items: center; padding: 0 9px; border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--navy-soft); color: var(--text); }
.hist-tags .v-ok { background: var(--green-soft); color: var(--green-2); }
.hist-tags .v-part { background: var(--amber-soft); color: var(--amber); }
.hist-tags .v-bad { background: var(--red-soft); color: var(--red); }
.hist-actions { display: flex; flex-direction: column; gap: 8px; align-items: stretch; }
.hist-actions .cta { height: 40px; min-width: 0; padding: 0 16px; font-size: 14px; border-radius: 12px; }
.hist-actions .btn { height: 36px; padding: 0 12px; font-size: 13px; }
.hist-actions .btn.danger:hover { border-color: var(--red); color: var(--red); }
.hist-empty { padding: 34px 28px; text-align: center; }
.hist-empty p { color: var(--text-2); margin: 6px 0 18px; }
.hist-more { display: flex; justify-content: center; margin-top: 16px; }
.danger-zone { margin-top: 36px; padding: 20px 22px; display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }
.danger-zone h2 { font-size: 16px; }
.danger-zone p { font-size: 13.5px; color: var(--text-2); margin-top: 2px; max-width: 560px; }
.danger-zone .btn { border-color: var(--red); color: var(--red); }
.confirm-card { width: min(460px, 100%); }
.confirm-card p { color: var(--text-2); margin: 8px 0 14px; font-size: 14.5px; line-height: 1.5; }
.confirm-card input { width: 100%; height: 44px; padding: 0 12px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--field); font: 500 15px "Figtree", sans-serif; color: var(--text); outline: 0; }
.confirm-card input:focus { border-color: var(--red); }
.confirm-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 16px; }
.confirm-actions .danger { background: var(--red); border-color: var(--red); color: #FFFFFF; }
.confirm-actions .danger:disabled { opacity: .45; }

@media (max-width: 720px) {
  .hist-item { grid-template-columns: minmax(0, 1fr); }
  .hist-thumb { display: none; }
  .hist-actions { flex-direction: row; flex-wrap: wrap; }
  .auth-card { padding: 24px 20px; }
}
