/* Customer web layout, on top of base.css: login, home, the chat and Mis aclaraciones. */

/* Login */
.login-wrap { display: flex; align-items: center; justify-content: center; padding: 48px 0; }
.login-brand { font-weight: 600; font-size: 16px; letter-spacing: -0.01em; }
.login-title { font-size: 26px; }
.doc-field {
  display: flex; gap: 8px; align-items: center; padding: 4px; border: 1px solid var(--field);
  border-radius: var(--radius-sm); background: var(--surface);
}
.doc-field select {
  width: auto; border: 0; border-radius: 8px; padding: 9px 10px; background: var(--surface-2);
  font-size: 14px; font-weight: 500;
}
.doc-field input { flex: 1; min-width: 0; border: 0; padding: 10px 6px; background: transparent; }
.doc-field:focus-within { border-color: var(--primary); }
.code-input { font: 22px var(--mono); letter-spacing: 0.4em; text-align: center; padding: 14px; }
.code-input[aria-invalid="true"] { border-color: var(--bad); }
.label-row { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 8px; }
.label-row label { margin: 0; }
.login-note { font-size: 12px; color: var(--muted); line-height: 1.5; }

/* The red counter of questions waiting for the customer */
.dot {
  display: inline-block; margin-left: 6px; min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: 999px; background: var(--bad); color: #ffffff; font: 600 11px/18px var(--sans);
  text-align: center; vertical-align: 1px;
}

/* Notifications (TRZ-32): the avatar opens the list, with the red counter on its corner. */
.notify-wrap { position: relative; display: flex; }
.avatar.notify { border: 0; padding: 0; cursor: pointer; font: 600 13px/1 var(--sans); }
.avatar .badge { position: absolute; top: -6px; right: -9px; margin: 0; }
.notif-panel {
  position: absolute; top: calc(100% + 10px); right: 0; z-index: 20; width: min(360px, calc(100vw - 32px));
  padding: 16px; display: flex; flex-direction: column; gap: 10px; box-shadow: var(--shadow-panel);
}
.notif-panel h2 { font-size: 15px; }
.notif-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.notif {
  width: 100%; display: flex; gap: 10px; align-items: flex-start; justify-content: space-between;
  padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--surface);
  color: var(--ink-2); font: 400 14px/1.45 var(--sans); text-align: left; cursor: pointer;
}
.notif.unread { background: var(--primary-soft); color: var(--ink); }
.notif .tag { flex: none; }
@media (max-width: 640px) {
  /* The avatar carries the counter, so it stays on a phone (decision D8). */
  .appbar .avatar.notify { display: flex; }
}

/* Home */
.figures { display: flex; flex-direction: column; gap: 4px; }
.figures .figure { font-size: clamp(30px, 4vw, 40px); font-weight: 600; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }

/* The card drawn as in the prototype: ink for debit, blue for credit. */
.vcard {
  position: relative; overflow: hidden; aspect-ratio: 1.586 / 1; max-height: 220px; border-radius: 18px;
  padding: 20px 22px; display: flex; flex-direction: column; justify-content: space-between; color: #ffffff;
  box-shadow: 0 1px 2px rgba(13, 19, 33, 0.12), 0 10px 24px rgba(13, 19, 33, 0.14);
}
.vcard.debit {
  background: radial-gradient(120% 90% at 100% 0%, rgba(198, 244, 50, 0.18) 0%, rgba(255, 255, 255, 0) 55%), var(--ink);
}
.vcard.credit {
  background: radial-gradient(120% 90% at 100% 0%, rgba(255, 255, 255, 0.28) 0%, rgba(255, 255, 255, 0) 55%), var(--primary);
}
.vcard-row { display: flex; justify-content: space-between; align-items: center; }
.vcard-row.start { justify-content: flex-start; gap: 14px; }
.vcard-brand { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 15px; letter-spacing: -0.01em; }
.vcard-logo {
  width: 24px; height: 24px; border-radius: 7px; display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700; background: var(--lime); color: var(--ink);
}
.vcard.credit .vcard-logo { background: #ffffff; color: var(--primary); }
.vcard-kind { font-size: 11px; letter-spacing: 0.14em; font-weight: 600; opacity: 0.8; }
.vcard-chip {
  position: relative; width: 42px; height: 32px; border-radius: 7px; overflow: hidden;
  background: linear-gradient(135deg, #f1e2b0 0%, #c9a85b 45%, #e8d69c 70%, #b8944a 100%);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.18);
}
.vcard-chip::before, .vcard-chip::after { content: ""; position: absolute; }
.vcard-chip::before {
  left: 0; right: 0; top: 33%; height: 33%;
  border-top: 1px solid rgba(80, 60, 20, 0.45); border-bottom: 1px solid rgba(80, 60, 20, 0.45);
}
.vcard-chip::after {
  top: 0; bottom: 0; left: 33%; width: 33%;
  border-left: 1px solid rgba(80, 60, 20, 0.45); border-right: 1px solid rgba(80, 60, 20, 0.45);
}
.vcard-wave { opacity: 0.85; }
.vcard-foot { display: flex; flex-direction: column; gap: 10px; }
.vcard-number { font: 17px var(--mono); letter-spacing: 0.14em; }
.vcard-holder { font-size: 12px; letter-spacing: 0.12em; font-weight: 500; }

/* Recent movements on the home */
.card.recent { padding: 8px 8px 12px; gap: 0; }
.recent-head { padding: 14px 16px 10px; }
.recent-row { display: flex; align-items: center; gap: 14px; padding: 12px 16px; border-radius: var(--radius-md); }
.recent-row .main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.recent-row .title { font-size: 15px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.recent-row .sub { font-size: 13px; color: var(--muted); }
.recent-row .end { display: flex; flex-direction: column; align-items: flex-end; gap: 3px; }
.recent-row .amount { font-size: 15px; font-weight: 500; font-variant-numeric: tabular-nums; }
.recent-row .approx { font-size: 12px; color: var(--muted); text-align: right; max-width: 220px; }
.recent-row .pill { align-self: flex-end; }
.recent-empty { padding: 0 16px 8px; }
.claim-mini {
  display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 0;
  border-top: 1px solid var(--line-soft);
}
.claim-mini > div { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.soft-title { font-size: 18px; letter-spacing: -0.01em; }
.soft-body { font-size: 14px; line-height: 1.5; color: var(--ink-2); }

/* Chat */
.chat-layout {
  display: grid; grid-template-columns: minmax(0, 820px) minmax(260px, 1fr); gap: 24px; align-items: start;
}
.chat-layout:has(> .trace[hidden]) { grid-template-columns: minmax(0, 820px); }
.chat-panel {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg);
  overflow: hidden; display: flex; flex-direction: column; box-shadow: var(--shadow-panel); min-width: 0;
}
.chat-head { display: flex; align-items: center; gap: 12px; padding: 14px 20px; border-bottom: 1px solid var(--line-soft); }
.chat-who { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.chat-who strong { font-size: 15px; font-weight: 600; }
.bot-mark {
  position: relative; flex: none; width: 32px; height: 32px; border-radius: 10px; background: var(--ink);
  color: var(--lime); display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 700;
}
.bot-mark.big { width: 40px; height: 40px; border-radius: 12px; font-size: 15px; }
.online {
  position: absolute; right: -2px; bottom: -2px; width: 12px; height: 12px; border-radius: 50%;
  background: var(--ok); border: 2px solid var(--surface);
}
.chat-body {
  background: var(--surface-3); padding: 22px clamp(14px, 3vw, 24px) 18px; display: flex;
  flex-direction: column; gap: 16px; min-height: min(62vh, 600px);
}
.log { flex: 1; display: flex; flex-direction: column; gap: 16px; }
.msg { display: flex; gap: 12px; align-items: flex-start; }
.msg.me { justify-content: flex-end; }
.turn { display: flex; flex-direction: column; gap: 12px; min-width: 0; flex: 1; }
.bubble {
  align-self: flex-start; max-width: 560px; padding: 12px 16px; font-size: 15px; line-height: 1.5;
  background: var(--surface); border: 1px solid var(--line); border-radius: 4px 18px 18px 18px;
  box-shadow: var(--shadow-soft); white-space: pre-wrap; overflow-wrap: anywhere;
}
.bubble .line { display: block; }
.msg.me .bubble {
  max-width: min(520px, 82%); background: var(--primary); color: var(--primary-ink); border: 0;
  border-radius: 18px 4px 18px 18px; box-shadow: none;
}
.sim-label { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-size: 13px; color: var(--muted); white-space: normal; }
.question { font-weight: 600; white-space: normal; }
.charge {
  background: var(--surface); border: 1px solid var(--line); border-radius: 4px 20px 20px 20px;
  padding: 22px; display: flex; flex-direction: column; gap: 18px;
}
.charge-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.charge-top > div { display: flex; flex-direction: column; gap: 4px; }
.charge-top .merchant { font-size: 20px; font-weight: 600; }
.charge-top .figure { font-size: 28px; font-weight: 600; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; text-align: right; }
.charge-top .approx { font-size: 12px; color: var(--muted); text-align: right; }
.choices { display: flex; gap: 10px; flex-wrap: wrap; }
.receipt {
  background: var(--surface); border: 1px solid var(--line); border-radius: 4px 20px 20px 20px; overflow: hidden;
}
.receipt-top { background: var(--ink); color: #ffffff; padding: 24px; display: flex; flex-direction: column; gap: 14px; }
.receipt-top .done { display: flex; align-items: center; gap: 8px; font-size: 15px; font-weight: 500; }
.receipt-top .done::before {
  content: "✓"; width: 22px; height: 22px; border-radius: 50%; background: var(--lime); color: var(--ink);
  display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 700;
}
.receipt-top .k { font-size: 13px; color: var(--faint); }
.receipt-top .folio { font: 500 clamp(22px, 3vw, 28px) var(--mono); letter-spacing: 0.02em; }
.receipt-bottom { padding: 20px 24px; display: flex; flex-direction: column; gap: 12px; }
.meta { font: 11px var(--mono); color: var(--muted); }
/* A message the request failed for: its mark and a retry, under its bubble. */
.msg.me { flex-wrap: wrap; }
.outgoing-note { flex-basis: 100%; display: flex; justify-content: flex-end; align-items: center; gap: 10px; }
/* The bubble of TRAZO while a reply is on its way; still dots for whoever prefers less motion. */
.typing-dots { display: flex; gap: 5px; align-items: center; color: var(--muted); font-size: 14px; }
.typing-word { margin-right: 4px; }
.typing-dots .dot {
  width: 7px; height: 7px; border-radius: 50%; background: var(--muted); opacity: 0.35;
  animation: typing-dot 1.2s infinite ease-in-out;
}
.typing-dots .dot:nth-child(2) { animation-delay: 0.2s; }
.typing-dots .dot:nth-child(3) { animation-delay: 0.4s; }
@keyframes typing-dot { 0%, 80%, 100% { opacity: 0.35; } 40% { opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
  .typing-dots .dot { animation: none; opacity: 0.7; }
}
.composer {
  display: flex; gap: 8px; align-items: center; padding: 8px 8px 8px 16px; background: var(--surface);
  border: 1px solid var(--field); border-radius: 16px;
}
.composer:focus-within { border-color: var(--primary); }
.composer input { flex: 1; min-width: 0; border: 0; padding: 8px 0; background: transparent; }
.composer .btn { padding: 10px 18px; font-size: 14px; }
.trace { position: sticky; top: 96px; padding: 20px; gap: 12px; }
.trace h2 { font-size: 15px; }
.trace [role="switch"] { align-self: flex-start; }
.trace [role="switch"][aria-checked="true"] { background: var(--primary-soft); border-color: var(--primary); }
.audit-trace { max-height: 420px; overflow-y: auto; padding-top: 4px; }

/* Mis aclaraciones */
.claims { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 380px), 1fr)); gap: 20px; align-items: start; }
.claim-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.claim-head > div { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.claim-head .title { font-size: 18px; font-weight: 600; }
.info-request { display: flex; flex-direction: column; gap: 12px; padding-top: 16px; border-top: 1px solid var(--line-soft); }
.info-entry { display: flex; flex-direction: column; gap: 8px; }
.info-entry + .info-entry { padding-top: 12px; border-top: 1px dashed var(--line); }
.info-entry .answer { white-space: pre-wrap; color: var(--ink-2); }
.page-note { margin-top: 20px; font-size: 13px; color: var(--muted); }

@media (max-width: 900px) {
  .chat-layout { grid-template-columns: minmax(0, 1fr); }
  .trace { position: static; }
}
@media (max-width: 640px) {
  .list-row .end { align-items: flex-start; }
}
