/* ---------------------------------------------------------------------------
   Estilos específicos por pantalla
   --------------------------------------------------------------------------- */

/* LOGIN --------------------------------------------------------------------- */

.screen--login .screen-body {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: var(--sp-6);
  padding: var(--sp-6);
}
.login-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--sp-3);
  margin-bottom: var(--sp-3);
}
.login-title {
  font-size: var(--fs-xl);
  font-weight: var(--fw-bold);
  letter-spacing: -0.02em;
  margin: var(--sp-3) 0 0;
}
.login-subtitle {
  font-size: var(--fs-sm);
  color: var(--text-2);
  text-align: center;
  letter-spacing: 0.02em;
}
.login-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: var(--sp-5);
  display: flex;
  flex-direction: column;
}
.login-error {
  background: var(--danger-fade);
  color: var(--danger);
  font-size: var(--fs-sm);
  font-weight: var(--fw-medium);
  padding: var(--sp-3);
  border-radius: var(--r-sm);
  margin-bottom: var(--sp-3);
}
.login-foot {
  text-align: center;
  margin-top: var(--sp-3);
}

/* HOME ---------------------------------------------------------------------- */

.home-greeting { margin-bottom: var(--sp-5); }
.home-name {
  font-size: var(--fs-xl);
  font-weight: var(--fw-bold);
  letter-spacing: -0.02em;
  margin: 4px 0 2px;
  line-height: 1.2;
}
.home-tiles {
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
  margin-bottom: var(--sp-5);
}
.home-tile {
  width: 100%;
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: var(--sp-4);
  text-align: left;
  cursor: pointer;
  min-height: 80px;
  transition: background var(--t-fast) var(--ease-snappy), border-color var(--t-fast) var(--ease-snappy), transform var(--t-fast) var(--ease-snappy);
}
.home-tile:hover { background: var(--surface-2); border-color: var(--border-strong); }
.home-tile:active { transform: translateY(1px); }
.home-tile[data-tone='primary'] {
  background: linear-gradient(135deg, var(--primary), var(--primary-hover));
  border-color: var(--primary);
  color: var(--text-on-primary);
}
.home-tile[data-tone='primary']:hover { filter: brightness(1.06); }
.home-tile[data-tone='primary'] .home-tile-desc { color: rgba(255, 255, 255, 0.85); }
.home-tile-icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
}
.home-tile[data-tone='neutral'] .home-tile-icon {
  background: var(--surface-2);
  color: var(--primary);
}
[data-theme='light'] .home-tile[data-tone='neutral'] .home-tile-icon {
  background: var(--primary-fade);
}
.home-tile-text { flex: 1; min-width: 0; }
.home-tile-title { font-size: var(--fs-md); font-weight: var(--fw-semibold); }
.home-tile-desc { font-size: var(--fs-sm); color: var(--text-2); margin-top: 2px; }
.home-tile-arrow {
  font-size: 22px;
  color: rgba(255, 255, 255, 0.6);
  flex-shrink: 0;
}
.home-tile[data-tone='neutral'] .home-tile-arrow { color: var(--text-muted); }

.home-summary-title {
  font-size: var(--fs-xs);
  font-weight: var(--fw-semibold);
  color: var(--text-2);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: var(--sp-2);
}
.home-summary-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--sp-2);
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: var(--sp-3) var(--sp-4);
}
.stat-card-label {
  font-size: var(--fs-xs);
  color: var(--text-2);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: var(--fw-semibold);
}
.stat-card-value {
  font-size: var(--fs-lg);
  font-weight: var(--fw-bold);
  margin-top: 2px;
  font-variant-numeric: tabular-nums;
}
.stat-card--mini { padding: var(--sp-2) var(--sp-3); }
.stat-card--mini .stat-card-value { font-size: var(--fs-md); }

/* CAPTURE ------------------------------------------------------------------- */

.inf-summary {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: var(--sp-3) var(--sp-4);
  margin-top: -8px;
  margin-bottom: var(--sp-4);
}
.inf-summary-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 4px 0;
}

.total-panel {
  background: linear-gradient(135deg, var(--surface), var(--surface-2));
  border: 1px solid var(--border-strong);
  border-radius: var(--r-lg);
  padding: var(--sp-4);
  text-align: right;
  margin-top: var(--sp-3);
}
.total-amount {
  font-size: var(--fs-3xl);
  font-weight: var(--fw-bold);
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
  margin-top: 2px;
}

/* SUMMARY ------------------------------------------------------------------- */

.summary-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: var(--sp-4);
}
.summary-folio {
  font-size: var(--fs-sm);
  color: var(--text-2);
  text-align: center;
  padding-bottom: var(--sp-3);
  border-bottom: 1px solid var(--border);
}
.summary-rows {
  display: flex;
  flex-direction: column;
  padding: var(--sp-3) 0;
  gap: var(--sp-1);
}
.summary-row {
  display: flex;
  justify-content: space-between;
  gap: var(--sp-3);
  padding: var(--sp-1) 0;
}
.summary-row-label { font-size: var(--fs-sm); color: var(--text-2); }
.summary-row-value {
  font-size: var(--fs-sm);
  font-weight: var(--fw-medium);
  text-align: right;
  max-width: 65%;
}
.summary-total {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  padding-top: var(--sp-3);
  border-top: 1px solid var(--border);
}
.summary-total-amount {
  font-size: var(--fs-display);
  font-weight: var(--fw-bold);
  letter-spacing: -0.03em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  color: var(--text);
}

/* QR ----------------------------------------------------------------------- */

.qr-instr {
  font-size: var(--fs-sm);
  color: var(--text-2);
  margin-top: var(--sp-2);
}
.qr-block {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: var(--sp-5);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--sp-3);
}
.qr-amount {
  font-size: var(--fs-3xl);
  font-weight: var(--fw-bold);
  letter-spacing: -0.02em;
  margin-top: var(--sp-2);
  font-variant-numeric: tabular-nums;
}
.qr-folio { letter-spacing: 0.02em; }
.qr-countdown {
  width: 100%;
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  overflow: hidden;
  margin-top: var(--sp-1);
}
.qr-countdown-bar {
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, var(--success), var(--warning));
  transition: width 1s linear;
}
.qr-expire-row {
  display: flex;
  justify-content: center;
  gap: 4px;
}

/* CARD ---------------------------------------------------------------------- */

.card-amount-block {
  text-align: center;
  padding: var(--sp-3) 0;
}
.card-amount-block .summary-total-amount { font-size: var(--fs-2xl); }

.card-slot {
  position: relative;
  height: 220px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: var(--sp-3);
  overflow: hidden;
}
.card-slot-card {
  width: 220px;
  height: 130px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--info) 100%);
  position: relative;
  box-shadow: 0 12px 24px rgba(24, 87, 184, 0.25);
  transition: transform 1.2s var(--ease-snappy);
}
.card-slot-chip {
  position: absolute;
  top: 30px;
  left: 24px;
  width: 36px;
  height: 28px;
  background: linear-gradient(135deg, #d8b54b, #c9a23a);
  border-radius: 4px;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,0.18);
}
.card-slot-stripe {
  position: absolute;
  bottom: 12px;
  left: 16px;
  right: 16px;
  height: 6px;
  background: rgba(255, 255, 255, 0.4);
  border-radius: 2px;
}
.card-slot-arrows {
  display: flex;
  gap: 6px;
  font-size: 22px;
  color: var(--text-2);
}
.card-slot-arrows span {
  animation: slideArrow 1.2s var(--ease-snappy) infinite;
}
.card-slot-arrows span:nth-child(2) { animation-delay: 0.15s; }
.card-slot-arrows span:nth-child(3) { animation-delay: 0.3s; }

.card-slot.is-reading .card-slot-card,
.card-slot.is-authorizing .card-slot-card {
  transform: translateY(40px) scale(0.95);
}
.card-slot.is-success {
  background: var(--success-fade);
  border-color: var(--success);
}
.card-slot.is-success::after {
  content: '✓';
  position: absolute;
  font-size: 100px;
  color: var(--success);
  font-weight: var(--fw-bold);
  z-index: 5;
}
.card-slot.is-rejected {
  background: var(--danger-fade);
  border-color: var(--danger);
}
.card-slot.is-rejected::after {
  content: '✕';
  position: absolute;
  font-size: 100px;
  color: var(--danger);
  font-weight: var(--fw-bold);
  z-index: 5;
}
.card-slot.is-review {
  background: var(--warning-fade);
  border-color: var(--warning);
}
.card-slot.is-review::after {
  content: '⏱';
  position: absolute;
  font-size: 80px;
  color: var(--warning);
  font-weight: var(--fw-bold);
  z-index: 5;
}

.card-instr {
  font-size: var(--fs-sm);
  color: var(--text-2);
}

@keyframes slideArrow {
  0%, 100% { opacity: 0.3; transform: translateX(-2px); }
  50% { opacity: 1; transform: translateX(2px); }
}

/* RECEIPT ------------------------------------------------------------------- */

.screen--receipt .screen-body { padding: 0; }
.receipt-card {
  background: var(--surface);
  margin: var(--sp-4) var(--sp-5);
  border-radius: var(--r-lg);
  border: 1px solid var(--border);
  padding: var(--sp-4);
}
.receipt-details { display: flex; flex-direction: column; }
.receipt-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-3) 0;
  border-bottom: 1px solid var(--border);
}
.receipt-row:last-child { border-bottom: 0; }
.receipt-row-label {
  font-size: var(--fs-xs);
  color: var(--text-2);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: var(--fw-semibold);
}
.receipt-row-value {
  font-size: var(--fs-sm);
  font-weight: var(--fw-medium);
  text-align: right;
  max-width: 60%;
  color: var(--text);
}

/* HISTORY ------------------------------------------------------------------- */

.history-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--sp-2);
  margin-bottom: var(--sp-3);
}
.history-row-time {
  font-size: var(--fs-xs);
  color: var(--text-2);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  letter-spacing: 0.04em;
}

/* LOOKUP -------------------------------------------------------------------- */

.lookup-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: var(--sp-4);
  display: flex;
  flex-direction: column;
  gap: var(--sp-4);
}
.lookup-card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: var(--sp-3);
  border-bottom: 1px solid var(--border);
  font-size: var(--fs-sm);
}
.lookup-card-rows { display: flex; flex-direction: column; }
.lookup-row {
  display: flex;
  justify-content: space-between;
  gap: var(--sp-3);
  padding: var(--sp-2) 0;
  border-bottom: 1px solid var(--border);
}
.lookup-row:last-child { border-bottom: 0; }
.lookup-row-k {
  font-size: var(--fs-xs);
  color: var(--text-2);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: var(--fw-semibold);
}
.lookup-row-v {
  font-size: var(--fs-sm);
  font-weight: var(--fw-medium);
  text-align: right;
  max-width: 65%;
}
