/* ============================================================ */
/* LegalFlow — auth pages (login + signup)                       */
/* Low-fi, grayscale. NO topbar / NO bottom-nav.                 */
/* Estilo pelado patrón Linear / Notion / Vercel.                */
/* ============================================================ */

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

body {
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  background: #f6f6f4;
  color: #222;
  font-size: 14px;
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* HEADER pre-login */
.auth-header {
  padding: 18px 24px;
  border-bottom: 1px solid #e0e0dd;
  background: #fff;
}
.auth-header .brand {
  font-weight: 700;
  font-size: 17px;
  color: #222;
  text-decoration: none;
}

main {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
}

/* CARD */
.auth-card {
  width: 100%;
  max-width: 440px;
  background: #fff;
  border: 1px solid #ccc;
  padding: 28px 28px 24px;
}

h1.auth-title {
  font-size: 22px;
  font-weight: 600;
  margin: 0 0 6px;
  color: #222;
}
.auth-subtitle {
  font-size: 13px;
  color: #666;
  margin: 0 0 22px;
}

/* BANNERS */
.auth-banner {
  margin: 0 0 18px;
  padding: 10px 12px;
  font-size: 13px;
  border: 1px solid #ccc;
  background: #fafafa;
}
.auth-banner.error {
  background: #fef2f2;
  border-color: #fca5a5;
  color: #991b1b;
}
.auth-banner.success {
  background: #f0fdf4;
  border-color: #86efac;
  color: #166534;
}

/* FIELDS */
.auth-field { margin-bottom: 14px; }
.auth-field label {
  display: block;
  font-size: 12px;
  color: #555;
  margin-bottom: 5px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.auth-field input {
  width: 100%;
  padding: 9px 11px;
  border: 1px solid #999;
  font-family: inherit;
  font-size: 14px;
  color: #222;
  background: #fff;
}
.auth-field input:focus { outline: none; border-color: #222; }

/* PASSWORD field con toggle "ojito" */
.pw-wrapper { position: relative; }
.pw-wrapper input { padding-right: 40px; }
.pw-toggle {
  position: absolute;
  top: 0; right: 0; bottom: 0;
  width: 38px;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #888;
}
.pw-toggle:hover { color: #222; }
.pw-toggle:focus { outline: none; color: #222; }
.pw-toggle svg { display: block; }
.pw-toggle .pw-icon-hide { display: none; }
.pw-toggle.is-visible .pw-icon-show { display: none; }
.pw-toggle.is-visible .pw-icon-hide { display: block; }

.auth-field .hint {
  font-size: 11px;
  color: #888;
  margin-top: 4px;
}

.field-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 5px;
}
.field-row label { margin: 0; }
.field-row .forgot {
  font-size: 12px;
  color: #666;
  text-decoration: underline;
}
.field-row .forgot:hover { color: #222; }

/* CTA */
.auth-submit {
  width: 100%;
  margin-top: 8px;
  padding: 12px 16px;
  background: #222;
  color: #fff;
  border: 1.5px solid #222;
  font-size: 14px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
}
.auth-submit:hover { background: #444; }
.auth-submit:disabled {
  background: #999;
  border-color: #999;
  cursor: not-allowed;
}

/* CROSS link debajo del CTA */
.auth-cross {
  text-align: center;
  margin-top: 18px;
  font-size: 13px;
  color: #666;
}
.auth-cross a {
  color: #222;
  text-decoration: underline;
  font-weight: 600;
}
.auth-cross a:hover { color: #000; }

/* Términos legales en signup */
.auth-legal {
  margin-top: 14px;
  text-align: center;
  font-size: 11px;
  color: #888;
  line-height: 1.55;
}
.auth-legal a { color: #666; text-decoration: underline; }
.auth-legal a:hover { color: #222; }

/* FOOTER */
.page-footer {
  padding: 16px 24px;
  text-align: center;
  font-size: 11px;
  color: #888;
  border-top: 1px solid #e8e8e6;
  background: #fff;
}
.page-footer .brand-mini { font-weight: 600; color: #666; }

/* ============================================================ */
/* INVITACIÓN — pantalla compact (user logueado coincide)         */
/* + banner contextual cuando es signup desde invite              */
/* Usado SOLO por templates/invitacion.html.                      */
/* ============================================================ */

/* Banner que va arriba del card cuando el invitado tiene que crear cuenta */
.invite-banner {
  width: 100%; max-width: 440px;
  background: #f0efeb;
  border: 1px solid #ccc;
  border-bottom: none;
  padding: 14px 18px;
  font-size: 13px; color: #444;
  text-align: center; line-height: 1.55;
}
.invite-banner strong { color: #222; font-weight: 700; }
.invite-banner .role-chip {
  display: inline-block;
  border: 1px solid #999;
  padding: 1px 7px;
  font-size: 10px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.05em;
  color: #444; background: #fff;
  margin-left: 4px;
  vertical-align: 1px;
}

/* Card compact (user logueado): avatar + headline + 2 botones */
.invite-from {
  display: flex; align-items: center; gap: 12px;
  margin-bottom: 22px;
}
.invite-avatar {
  width: 44px; height: 44px;
  border-radius: 50%; background: #222; color: #fff;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 700; flex-shrink: 0;
}
.invite-from-meta { font-size: 13px; color: #666; }
.invite-from-meta .name { color: #222; font-weight: 600; font-size: 14px; }

.invite-headline {
  font-size: 20px; font-weight: 600;
  color: #222;
  margin: 0 0 8px;
  line-height: 1.4;
}
.invite-headline .estudio { font-weight: 700; }
.invite-role {
  display: inline-block;
  border: 1px solid #999;
  padding: 2px 9px;
  font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.05em;
  color: #444; background: #fafafa;
  margin-left: 2px;
  vertical-align: 2px;
}
.invite-tool-blurb {
  font-size: 13px; color: #666;
  margin: 0 0 24px;
  line-height: 1.55;
}

/* Stack de 2 botones (Aceptar / No me interesa) */
.invite-actions {
  display: flex; flex-direction: column; gap: 10px;
}
.invite-btn {
  width: 100%;
  padding: 12px 16px;
  font-size: 14px; font-family: inherit;
  cursor: pointer;
  border: 1.5px solid #222;
}
.invite-btn.primary {
  background: #222; color: #fff; font-weight: 700;
}
.invite-btn.primary:hover { background: #444; }
.invite-btn.secondary {
  background: transparent; color: #555;
  border-color: #bbb; font-weight: 500;
}
.invite-btn.secondary:hover { color: #222; border-color: #888; }

/* Wrapper que junta banner + card sin doble borde */
.auth-block {
  width: 100%; max-width: 440px;
  display: flex; flex-direction: column;
}

/* Readonly input look (email pre-llenado del invite) */
.auth-field input[readonly] {
  background: #f5f5f3; color: #555; cursor: not-allowed;
  border-color: #ccc;
}

/* wordmark de la marca en el header de las pantallas de acceso */
.auth-header .brand img, .brand img { height: 24px; display: block; }
