/*
 * Estilos base para login, perfil y permisos.
 * Los colores (--bg, --accent, etc) los define theme.css.
 */

body {
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  margin: 0;
}

a { color: inherit; text-decoration: none; }
button, input { font: inherit; }

.zt-page {
  max-width: 920px;
  margin: 0 auto;
  padding: 24px;
}

.zt-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 24px;
  border-bottom: 1px solid var(--line);
  background: var(--top-bg);
  position: sticky;
  top: 0;
  z-index: 10;
}

.zt-brand b { font-size: 21px; }
.zt-brand small { display:block; color:var(--muted); margin-top:2px; }

.zt-brand{
  display:flex;
  align-items:center;
  gap:10px;
}

.zt-brand img{
  display:block;
  height:46px;
  width:auto;
  max-width:70px;
  object-fit:contain;
  flex-shrink:0;
}

 .zt-auth-card {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  border: 1px solid var(--line);
  background: var(--panel);
  border-radius: 16px;
  padding: 12px;
}

/*
 * El botón de Google (SDK externo) tiene un ancho fijo en píxeles que
 * CSS no puede controlar directamente porque vive dentro de un iframe.
 * Limitamos su contenedor para que nunca fuerce scroll horizontal de
 * toda la página; el ancho real que Google usa se pasa desde auth.js.
 */
#googleLoginButton {
  max-width: 100%;
  overflow: hidden;
}

.zt-auth-card p {
  color: var(--muted);
  font-size: 13px;
  margin: 3px 0 0;
}

.zt-auth-card.logged {
  min-width: min(100%, 460px);
}

.zt-avatar, .profile-logo {
  display: grid;
  place-items: center;
  overflow: hidden;
  background: var(--panel2);
  border: 1px solid var(--line);
  color: var(--muted);
}

.zt-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  flex-shrink: 0;
}

.zt-avatar img,
.profile-logo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.zt-auth-info {
  min-width: 0;
  flex: 1;
}

.zt-auth-info b,
.zt-auth-info p {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.zt-auth-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.zt-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 8px 13px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel2);
  color: var(--text);
  cursor: pointer;
}

.zt-btn.primary {
  background: var(--accent);
  color: var(--on-accent);
  border-color: var(--accent);
  font-weight: 700;
}

.zt-btn.danger {
  border-color: rgba(224,119,119,.45);
  color: var(--danger);
}

.zt-badges {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 5px;
}

.zt-badge {
  font-size: 11px;
  padding: 3px 7px;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--muted);
}

.zt-badge.admin {
  background: rgba(var(--accent-rgb),.12);
  border-color: rgba(var(--accent-rgb),.35);
  color: var(--accent);
}

.zt-badge.verified {
  background: rgba(128,211,134,.11);
  border-color: rgba(128,211,134,.35);
  color: var(--ok);
}

.zt-panel {
  border: 1px solid var(--line);
  background: var(--panel);
  border-radius: 18px;
  padding: 20px;
  margin-top: 18px;
}

.zt-panel h2 {
  margin: 0 0 6px;
}

.muted {
  color: var(--muted);
}

.profile-head {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 18px 0;
  padding: 14px;
  border-radius: 14px;
  background: var(--panel2);
  border: 1px solid var(--line);
}

.profile-logo {
  width: 76px;
  height: 76px;
  border-radius: 18px;
  font-size: 34px;
  flex-shrink: 0;
}

label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
  margin: 14px 0;
}

input {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--field-bg);
  color: var(--text);
  padding: 9px 11px;
}

.zt-status {
  margin-top: 14px;
  color: var(--muted);
}

.zt-status.ok { color: var(--ok); }
.zt-status.err { color: var(--danger); }

input {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--field-bg);
  color: var(--text);
  padding: 9px 11px;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

/*
 * Los inputs type="file" renderizan su propio botón + nombre de archivo
 * con contenido nativo del navegador que no respeta automáticamente el
 * ancho del contenedor. Sin este freno, en pantallas angostas el texto
 * ("ningún archivo seleccionado") se sale del recuadro redondeado.
 */
input[type="file"] {
  overflow: hidden;
  padding: 8px 10px;
}


@media (max-width: 720px) {
  .zt-top {
    align-items: flex-start;
    flex-direction: column;
    position: static;
  }

  .zt-auth-card.logged {
    width: 100%;
    flex-wrap: wrap;
  }

  .zt-auth-actions {
    flex: 1 0 100%;
    justify-content: flex-start;
    margin-top: 4px;
  }
}