/* Tablet — interfaz mínima (sin tema del manager) */
*,
*::before,
*::after {
  box-sizing: border-box;
}

.t-body {
  margin: 0;
  min-height: 100vh;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 17px;
  line-height: 1.45;
  color: #111;
  background: #fff;
  -webkit-font-smoothing: antialiased;
}

/* Cabecera fija con logo centrado */
.t-top {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 0.75rem;
  padding: 0.85rem 1rem 1rem;
  border-bottom: 1px solid #e8e8e8;
  background: #fff;
  position: sticky;
  top: 0;
  z-index: 20;
}

.t-top__center {
  grid-column: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  text-align: center;
}

.t-top__side--left {
  grid-column: 1;
}

.t-top__side--right {
  grid-column: 3;
  display: flex;
  justify-content: flex-end;
  align-items: center;
}

.t-top__logo {
  display: block;
  line-height: 0;
}

.t-top__logo img {
  display: block;
  height: 104px;
  width: auto;
  max-width: min(364px, 85vw);
  object-fit: contain;
  margin: 0 auto;
}

.t-top__centro {
  font-size: 0.82rem;
  color: #777;
  font-weight: 500;
}

.t-top__exit {
  flex-shrink: 0;
  font-size: 0.9rem;
  color: #666;
  text-decoration: none;
  padding: 0.5rem 0.65rem;
  border: 1px solid #ddd;
  border-radius: 8px;
}

.t-top__exit:active {
  background: #f5f5f5;
  color: #111;
}

.t-screen--login {
  padding-top: 1.5rem;
}

.t-screen--login .t-form {
  margin-top: 0.5rem;
}

/* Avisos */
.t-flash-list {
  list-style: none;
  margin: 0;
  padding: 0.65rem 1rem 0;
}

.t-flash {
  padding: 0.65rem 0.85rem;
  border-radius: 8px;
  font-size: 0.95rem;
  margin-bottom: 0.5rem;
}

.t-flash--error {
  background: #fdecea;
  color: #b71c1c;
}

.t-flash--success {
  background: #e8f5e9;
  color: #1b5e20;
}

/* Contenedor */
.t-main {
  max-width: 520px;
  margin: 0 auto;
  padding: 1rem 1.1rem 2.5rem;
}

.t-screen--wide {
  max-width: 720px;
}

.t-main:has(.t-screen--wide) {
  max-width: 720px;
}

/* Pasos */
.t-steps {
  display: flex;
  gap: 0.35rem;
  margin-bottom: 1.25rem;
}

.t-steps__item {
  flex: 1;
  text-align: center;
  font-size: 0.72rem;
  font-weight: 600;
  color: #bbb;
  padding: 0.45rem 0.2rem;
  border-bottom: 3px solid #eee;
}

.t-steps__item.is-on {
  color: #444;
  border-bottom-color: #ccc;
}

.t-steps__item.is-here {
  color: #111;
  border-bottom-color: #111;
}

/* Pantallas */
.t-screen__title,
.t-home__title {
  margin: 0 0 0.35rem;
  font-size: 1.65rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.t-screen__sub,
.t-home__sub {
  margin: 0 0 1.5rem;
  color: #666;
  font-size: 1rem;
}

.t-home {
  text-align: center;
  padding: 3rem 0 1rem;
}

.t-home--done {
  padding-top: 4rem;
}

.t-home--entrada {
  text-align: left;
  padding: 1.5rem 0 1rem;
}

.t-home--entrada .t-home__title,
.t-home--entrada .t-home__sub {
  text-align: center;
}

.t-home--entrada .t-btn--xl {
  margin-top: 1.5rem;
}

/* Citas del día en entrada tablet */
.t-citas {
  margin: 1.75rem 0 0;
  text-align: left;
}

.t-citas__title {
  margin: 0 0 0.35rem;
  font-size: 1.1rem;
  font-weight: 700;
}

.t-citas__hint,
.t-citas__empty {
  margin: 0 0 1rem;
  color: #666;
  font-size: 0.95rem;
}

.t-citas__list {
  list-style: none;
  margin: 0 0 0.5rem;
  padding: 0;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  overflow: hidden;
}

.t-citas__item {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.95rem 1rem;
  text-decoration: none;
  color: inherit;
  border-bottom: 1px solid #eee;
  background: #fff;
  transition: background 0.15s;
}

.t-citas__list li:last-child .t-citas__item {
  border-bottom: none;
}

.t-citas__item:active {
  background: #f5f5f5;
}

.t-citas__hora {
  flex-shrink: 0;
  min-width: 3rem;
  font-size: 1rem;
  font-weight: 700;
  color: #111;
}

.t-citas__info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.t-citas__nombre {
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.25;
}

.t-citas__meta {
  font-size: 0.85rem;
  color: #777;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.t-citas__badge {
  flex-shrink: 0;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.3rem 0.5rem;
  border-radius: 999px;
  text-align: center;
  max-width: 7.5rem;
  line-height: 1.2;
}

.t-citas__badge--datos {
  background: #fef3c7;
  color: #92400e;
}

.t-citas__badge--consentimientos {
  background: #dbeafe;
  color: #1e40af;
}

.t-citas__badge--completo {
  background: #dcfce7;
  color: #166534;
}

.t-done-icon {
  width: 3.5rem;
  height: 3.5rem;
  margin: 0 auto 1rem;
  border-radius: 50%;
  background: #111;
  color: #fff;
  font-size: 1.75rem;
  line-height: 3.5rem;
  font-weight: 700;
}

/* Formulario */
.t-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.t-field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.t-field__label {
  font-size: 0.9rem;
  font-weight: 600;
  color: #333;
}

.t-field__opt {
  font-weight: 400;
  color: #999;
}

.t-input {
  width: 100%;
  font: inherit;
  font-size: 1.1rem;
  padding: 0.85rem 0.9rem;
  min-height: 54px;
  border: 1px solid #ccc;
  border-radius: 8px;
  background: #fff;
  color: #111;
  -webkit-appearance: none;
  appearance: none;
}

.t-input:focus {
  outline: none;
  border-color: #111;
}

textarea.t-input {
  min-height: 80px;
  resize: vertical;
}

select.t-input--select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%23666' d='M1 1l5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.9rem center;
  padding-right: 2.25rem;
}

.t-field--groupon {
  border: 0;
  margin: 0;
  padding: 0;
}

.t-field--groupon legend {
  margin-bottom: 0.35rem;
}

.t-radio-row {
  display: flex;
  gap: 1.25rem;
  flex-wrap: wrap;
}

.t-notas-auto {
  margin: 0;
  font-size: 0.85rem;
  color: #666;
  line-height: 1.4;
  white-space: pre-wrap;
}

.t-visita-panel {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.t-visita-panel[hidden] {
  display: none !important;
}

.t-more {
  margin-top: 0.5rem;
  padding-top: 1rem;
  border-top: 1px solid #eee;
}

.t-more__title {
  margin: 0 0 1rem;
  font-size: 0.95rem;
  font-weight: 600;
  color: #555;
}

.t-more__body {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

/* Resumen */
.t-summary {
  margin-bottom: 1.5rem;
  padding: 1rem 0;
  border-top: 1px solid #eee;
  border-bottom: 1px solid #eee;
}

.t-summary__name {
  margin: 0 0 0.85rem;
  font-size: 1.35rem;
  font-weight: 700;
}

.t-summary__list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.t-summary__list li {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.55rem 0;
  font-size: 1rem;
  border-bottom: 1px solid #f0f0f0;
}

.t-summary__list li span {
  color: #888;
}

/* Lista consentimientos */
.t-checklist {
  list-style: none;
  margin: 0 0 1.25rem;
  padding: 0;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  overflow: hidden;
}

.t-checklist__item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem;
  border-bottom: 1px solid #eee;
  cursor: pointer;
  font-size: 1rem;
}

.t-checklist li:last-child .t-checklist__item {
  border-bottom: none;
}

.t-checklist__item input {
  width: 1.25rem;
  height: 1.25rem;
  flex-shrink: 0;
}

/* Botones */
.t-btn {
  display: block;
  width: 100%;
  font: inherit;
  font-size: 1.05rem;
  font-weight: 600;
  text-align: center;
  text-decoration: none;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  padding: 0.95rem 1rem;
  min-height: 56px;
  line-height: 1.2;
}

.t-btn--primary {
  background: #111;
  color: #fff;
}

.t-btn--primary:active:not(:disabled) {
  background: #333;
}

.t-btn--primary:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.t-btn--ghost {
  background: #f5f5f5;
  color: #333;
  margin-top: 0.5rem;
}

.t-btn--xl {
  font-size: 1.15rem;
  min-height: 60px;
  margin-top: 0.5rem;
}

.t-link-back {
  display: block;
  text-align: center;
  margin-top: 1.25rem;
  font-size: 0.95rem;
  color: #666;
  text-decoration: none;
}

.t-link-back:active {
  color: #111;
}

.t-note {
  text-align: center;
  font-size: 0.85rem;
  color: #999;
  margin: 0.75rem 0 0;
}

.t-link-inline {
  color: #333;
  font-weight: 600;
}

.t-note--warn {
  color: #b45309;
}

.t-check {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  font-size: 1rem;
  cursor: pointer;
  margin-bottom: 1rem;
}

.t-check input {
  width: 1.25rem;
  height: 1.25rem;
  margin-top: 0.15rem;
  flex-shrink: 0;
}

.t-check--inline {
  margin-bottom: 0.65rem;
}

.t-field--wa {
  margin-top: -0.35rem;
}

.t-field--wa[hidden] {
  display: none;
}

#cli-wa-wrap[hidden] {
  display: none;
}

/* Firma — documentos */
.t-sign-panel {
  margin-top: 1.25rem;
  padding-top: 1.25rem;
  border-top: 1px solid #eee;
}

.consent-firmar-bundle {
  margin-bottom: 1rem;
}

.consent-doc-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 0.5rem;
}

.consent-doc-preview {
  background: #fafafa;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  padding: 1rem 1.1rem;
}

.consent-doc-preview__head h2 {
  margin: 0 0 0.75rem;
  font-size: 1.05rem;
  font-weight: 700;
}

.consent-doc-preview__body {
  font-size: 0.92rem;
  line-height: 1.55;
  max-height: 40vh;
  overflow-y: auto;
  margin-bottom: 0.75rem;
  color: #333;
}

.consent-doc-preview__body ul {
  padding-left: 1.2rem;
}

.consent-doc-preview__body h3 {
  font-size: 0.98rem;
  margin: 1.1rem 0 0.5rem;
  font-weight: 700;
}

.consent-doc-preview__body h2 {
  font-size: 1.05rem;
  margin: 0 0 0.75rem;
}

.consent-doc-preview__sign-label {
  margin: 0 0 0.4rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: #555;
}

.consent-sign-copy-wrap {
  min-height: 60px;
  margin: 0.35rem 0 0.5rem;
  border: 1px solid #ddd;
  border-radius: 6px;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
}

.consent-sign-copy {
  max-width: 100%;
  max-height: 80px;
  object-fit: contain;
}

.consent-doc-preview__foot {
  font-size: 0.85rem;
  color: #666;
  border-top: 1px solid #eee;
  padding-top: 0.65rem;
}

.consent-signature-pad {
  display: block;
  width: 100%;
  height: 160px;
  border: 1px solid #ccc;
  border-radius: 8px;
  background: #fafafa;
  touch-action: none;
  margin-bottom: 0.5rem;
}

.consent-status-msg {
  font-size: 0.9rem;
  color: #666;
  text-align: center;
  margin: 0.75rem 0 0;
}

.consent-status-msg.is-error {
  color: #c62828;
}

@media (min-width: 600px) {
  .t-main {
    padding-top: 1.5rem;
  }

  .t-home {
    padding-top: 4rem;
  }
}
