/**
 * Estilos compartidos para páginas legales (Casa Tanimisha / Tani).
 * Reutiliza los tokens visuales del chat (empleado.html) sin alterar su diseño.
 */
:root {
  --primary: #192651;
  --primary-deep: #111c3a;
  --gold: #CAA04F;
  --gold-light: #e8c97e;
  --bg: #F4F2ED;
  --surface: #FFFFFF;
  --text: #1a1a2e;
  --text-muted: #6b7280;
  --border: #e5e1d8;
}

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

html, body {
  min-height: 100%;
  font-family: 'Inter', sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

/* Shell: misma anchura máxima que el chat */
.legal-shell {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
  max-width: 560px;
  margin: 0 auto;
  background: var(--bg);
}

/* Header idéntico a .chat-header de empleado.html */
.chat-header {
  flex-shrink: 0;
  background: linear-gradient(135deg, var(--primary) 0%, #1e3173 100%);
  color: #fff;
  padding: 14px 16px;
  padding-top: max(14px, env(safe-area-inset-top, 0px));
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: 0 2px 12px rgba(25, 38, 81, .35);
  z-index: 10;
}

.chat-header a.header-home {
  display: flex;
  align-items: center;
  gap: 12px;
  color: inherit;
  text-decoration: none;
  flex: 1;
  min-width: 0;
}

.avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
  border: 2px solid rgba(202, 160, 79, .5);
}

.avatar img {
  width: 140%;
  height: 140%;
  object-fit: cover;
  display: block;
  margin: -20% 0 0 -20%;
}

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

.header-name {
  font-family: 'Playfair Display', serif;
  font-size: 17px;
  font-weight: 700;
  line-height: 1.2;
}

.header-sub {
  font-size: 11px;
  opacity: .75;
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: 2px;
}

.online-dot {
  width: 7px;
  height: 7px;
  background: #4ade80;
  border-radius: 50%;
  box-shadow: 0 0 0 2px rgba(74, 222, 128, .3);
}

.admin-btn {
  background: rgba(255, 255, 255, .12);
  border: 1px solid rgba(255, 255, 255, .2);
  color: #fff;
  border-radius: 8px;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background .2s;
  text-decoration: none;
  flex-shrink: 0;
}

.admin-btn:hover { background: rgba(255, 255, 255, .22); color: #fff; }

/* Contenido legal */
.legal-main {
  flex: 1;
  padding: 20px 16px 28px;
  padding-bottom: max(28px, env(safe-area-inset-bottom, 0px));
}

.legal-card {
  background: var(--surface);
  border-radius: 14px;
  padding: 20px 18px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, .08);
  border: 1px solid var(--border);
}

.legal-card h1 {
  font-family: 'Playfair Display', serif;
  font-size: 22px;
  font-weight: 700;
  color: var(--primary);
  line-height: 1.25;
  margin-bottom: 6px;
}

.legal-meta {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}

.legal-card h2 {
  font-family: 'Playfair Display', serif;
  font-size: 16px;
  font-weight: 700;
  color: var(--primary);
  margin: 22px 0 8px;
}

.legal-card h3 {
  font-size: 13px;
  font-weight: 600;
  color: var(--primary);
  margin: 14px 0 6px;
}

.legal-card p,
.legal-card li {
  font-size: 13px;
  line-height: 1.6;
  color: #374151;
}

.legal-card p { margin-bottom: 10px; }

.legal-card ul,
.legal-card ol {
  margin: 0 0 12px 1.15rem;
}

.legal-card li { margin-bottom: 5px; }

.legal-card a {
  color: var(--primary);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.legal-card a:hover { color: var(--gold); }

.legal-note {
  background: #faf9f7;
  border: 1px solid var(--border);
  border-left: 3px solid var(--gold);
  border-radius: 0 10px 10px 0;
  padding: 12px 14px;
  font-size: 12px;
  color: #4b5563;
  line-height: 1.55;
  margin: 14px 0;
}

/* Formulario (mismas clases visuales que welcome-card) */
.wc-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--primary);
  display: block;
  margin-bottom: 4px;
}

.wc-input {
  width: 100%;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 13px;
  font-family: 'Inter', sans-serif;
  outline: none;
  transition: border-color .2s;
  background: #faf9f7;
  color: var(--text);
  margin-bottom: 12px;
}

.wc-input:focus {
  border-color: var(--primary);
  background: #fff;
}

textarea.wc-input {
  min-height: 110px;
  resize: vertical;
  line-height: 1.45;
}

.wc-btn-primary {
  width: 100%;
  margin-top: 4px;
  background: linear-gradient(135deg, #192651, #1e3173);
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 12px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  font-family: 'Inter', sans-serif;
  transition: opacity .2s;
}

.wc-btn-primary:hover { opacity: .9; }

.form-feedback {
  display: none;
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 12px;
  line-height: 1.45;
}

.form-feedback.ok {
  display: block;
  background: #d1fae5;
  color: #065f46;
  border: 1px solid #86efac;
}

.form-feedback.err {
  display: block;
  background: #fee2e2;
  color: #991b1b;
  border: 1px solid #fecaca;
}

/* Footer legal (compartido) */
.site-legal-footer {
  flex-shrink: 0;
  background: var(--primary-deep);
  color: rgba(255, 255, 255, .78);
  padding: 14px 16px max(16px, env(safe-area-inset-bottom, 0px));
  text-align: center;
  font-size: 11px;
  line-height: 1.5;
}

.site-legal-footer nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px 14px;
  margin-bottom: 8px;
}

.site-legal-footer a {
  color: #fff;
  text-decoration: none;
  font-weight: 500;
  border-bottom: 1px solid transparent;
  transition: color .15s, border-color .15s;
}

.site-legal-footer a:hover,
.site-legal-footer a[aria-current="page"] {
  color: var(--gold-light);
  border-bottom-color: rgba(232, 201, 126, .5);
}

.site-legal-footer .footer-copy {
  opacity: .65;
  font-size: 10px;
}

@media (max-width: 380px) {
  .legal-card { padding: 16px 14px; }
  .legal-card h1 { font-size: 20px; }
  .site-legal-footer nav { gap: 8px 12px; }
}

@media (max-width: 640px) {
  .legal-shell {
    max-width: 100%;
    padding-left: env(safe-area-inset-left, 0px);
    padding-right: env(safe-area-inset-right, 0px);
  }
  .chat-header { padding: 12px 14px; }
  .legal-card { font-size: 16px; overflow-wrap: anywhere; }
}
