/* Aeleo · estilos de acceso (login), avisos y usuario conectado.
   Usa los mismos tokens de color que la app (definidos en index.html). */

html { color-scheme: light dark; }
html:not(.rt-authed) .app { visibility: hidden; }

/* ---------- Pantalla de acceso ---------- */
.rt-login {
  position: fixed; inset: 0; z-index: 100;
  display: flex; align-items: center; justify-content: center;
  padding: 24px 16px;
  background:
    radial-gradient(1200px 600px at 85% -10%, rgba(138,133,167,.28), transparent 60%),
    radial-gradient(900px 500px at -10% 110%, rgba(138,133,167,.18), transparent 60%),
    #130F33;
  overflow-y: auto;
}
.rt-login[hidden] { display: none; }
.rt-card {
  width: min(400px, 100%);
  background: #FAF9F5; color: #130F33;
  border-radius: 16px;
  padding: 34px 30px 26px;
  box-shadow: 0 24px 60px rgba(0,0,0,.35);
}
.rt-logo { display: block; height: 30px; width: auto; color: #130F33; margin-bottom: 22px; }
.rt-logo path { fill: currentColor; }
.rt-card h1 {
  font-family: "Cormorant Garamond", Georgia, serif;
  font-weight: 600; font-size: 27px; line-height: 1.15; margin: 0 0 6px;
}
.rt-sub { margin: 0 0 22px; font-size: 13.5px; color: #6E6885; line-height: 1.5; }
.rt-sub b { color: #130F33; font-weight: 600; word-break: break-all; }
.rt-field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.rt-field label { font-size: 12px; font-weight: 600; color: #6E6885; }
.rt-field input {
  font: inherit; font-size: 15px; color: #130F33; background: #fff;
  border: 1px solid #E5E0D8; border-radius: 8px; padding: 12px 13px; width: 100%;
}
.rt-field input:focus { outline: 2px solid #3D3860; outline-offset: 1px; border-color: transparent; }
.rt-field input.rt-code-input {
  font-size: 24px; letter-spacing: 10px; text-align: center; font-variant-numeric: tabular-nums; padding: 12px 8px;
}
.rt-btn {
  display: flex; align-items: center; justify-content: center; gap: 9px; width: 100%;
  font: inherit; font-size: 14px; font-weight: 600; cursor: pointer;
  border-radius: 8px; padding: 12px 14px; border: 1px solid transparent;
  background: #130F33; color: #fff; transition: filter .15s ease, background .15s ease;
}
.rt-btn:hover { filter: brightness(1.15); }
.rt-btn:disabled { opacity: .55; cursor: progress; }
.rt-btn.rt-secondary { background: #fff; color: #130F33; border-color: #E5E0D8; }
.rt-btn.rt-secondary:hover { filter: none; background: #F0EDE8; }
.rt-btn svg { width: 18px; height: 18px; flex: none; }
.rt-or { display: flex; align-items: center; gap: 10px; margin: 16px 0; font-size: 11.5px; color: #6E6885; }
.rt-or::before, .rt-or::after { content: ""; flex: 1; height: 1px; background: #E5E0D8; }
.rt-or[hidden], .rt-btn[hidden] { display: none; }
.rt-links { display: flex; justify-content: space-between; gap: 10px; margin-top: 14px; }
.rt-link {
  border: none; background: none; padding: 0; font: inherit; font-size: 12.5px;
  color: #3D3860; text-decoration: underline; text-underline-offset: 3px; cursor: pointer;
}
.rt-login-msg { min-height: 18px; margin: 12px 0 0; font-size: 12.5px; color: #2E7D4F; }
.rt-login-msg.err { color: #B23B2E; }
.rt-login-msg:empty { display: none; }
.rt-foot { margin: 22px 0 0; font-size: 11px; color: #8A85A7; text-align: center; }

/* ---------- Usuario conectado (barra lateral) ---------- */
.rt-user { display: flex; align-items: center; gap: 8px; padding: 0 2px; min-width: 0; }
.rt-user-email { font-size: 11.5px; color: var(--ink-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; flex: 1; }
.rt-logout {
  flex: none; display: inline-flex; align-items: center; gap: 5px;
  border: 1px solid var(--border); background: var(--surface); color: var(--ink-muted);
  border-radius: 6px; padding: 4px 8px; font: inherit; font-size: 11.5px; font-weight: 600; cursor: pointer;
}
.rt-logout:hover { color: var(--ink); border-color: var(--accent-soft); }
.rt-logout svg { width: 13px; height: 13px; }
@media (max-width: 860px) {
  .rt-user { flex: none; }
  .rt-user-email, .rt-logout span { display: none; }
  .rt-logout { padding: 7px; border-radius: 50%; }
  .rt-logout svg { width: 15px; height: 15px; }
}
@media print { .rt-user, .rt-toast, .rt-login { display: none !important; } }

/* ---------- Avisos ---------- */
.rt-toast {
  position: fixed; left: 50%; bottom: 24px; z-index: 120;
  transform: translate(-50%, 16px); opacity: 0; pointer-events: none;
  max-width: min(520px, calc(100vw - 32px));
  background: #130F33; color: #fff; font-size: 13px; line-height: 1.4;
  padding: 11px 16px; border-radius: 10px; box-shadow: 0 10px 30px rgba(0,0,0,.25);
  transition: opacity .18s ease, transform .18s ease;
}
.rt-toast.show { opacity: 1; transform: translate(-50%, 0); }
.rt-toast.err { background: #B23B2E; }
.rt-toast.warn { background: #A9752A; }

/* ---------- Copia de seguridad ---------- */
.rt-icon-only { padding: 4px 6px; }
@media (max-width: 860px) { .rt-icon-only { padding: 7px; } }
.rt-modal-bg {
  position: fixed; inset: 0; z-index: 110; display: flex; align-items: center; justify-content: center;
  padding: 20px; background: rgba(15,12,36,.45);
}
.rt-modal-bg[hidden] { display: none; }
.rt-modal {
  position: relative; width: min(440px, 100%); max-height: 88vh; overflow: auto;
  background: var(--surface); color: var(--ink); border-radius: 14px; padding: 26px 24px 20px;
  box-shadow: 0 24px 60px rgba(0,0,0,.3);
}
.rt-modal h2 { font-family: "Cormorant Garamond", Georgia, serif; font-weight: 600; font-size: 23px; margin: 0 0 4px; }
.rt-modal h3 { font-size: 13px; font-weight: 700; margin: 20px 0 4px; }
.rt-modal .rt-sub { color: var(--ink-muted); margin: 0 0 10px; font-size: 12.5px; }
.rt-modal .rt-sub b { color: var(--ink); }
.rt-modal-x {
  position: absolute; top: 10px; right: 12px; border: none; background: none; font-size: 22px; line-height: 1;
  color: var(--ink-muted); cursor: pointer; padding: 4px 8px;
}
.rt-file { font: inherit; font-size: 12.5px; color: var(--ink-muted); margin-bottom: 10px; max-width: 100%; }
.rt-btn.rt-danger { background: #B23B2E; }
.rt-modal .rt-btn:not(.rt-danger) { background: var(--accent); color: var(--accent-contrast); }

/* Quién está dentro (A de Alberto, C de Cristina) */
.rt-presencia { display: flex; gap: 6px; padding: 0 2px 8px; flex-wrap: wrap; }
.rt-presencia:empty { display: none; }
.rt-pres { width: 26px; height: 26px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
  font: 700 12px/1 "DM Sans", system-ui, sans-serif; color: #fafaf8; background: #8a85a7; position: relative; cursor: default; }
.rt-pres-alberto { background: #130f33; }
.rt-pres-cristina { background: #b07a4f; }
.rt-pres::after { content: ""; position: absolute; right: -1px; bottom: -1px; width: 8px; height: 8px; border-radius: 50%; background: #3aa76d; border: 2px solid #fafaf8; }
.rt-pres.yo { outline: 2px solid rgba(138,133,167,.45); outline-offset: 1px; }
