:root {
  --ink: #101a2f;
  --muted: #5b6882;
  --line: rgba(10, 79, 143, 0.16);
  --bg: #f4f8ff;
  --panel: #ffffff;
  --brand: #0a4f8f;
  --brand-dark: #07182f;
  --blue: #0d7ee8;
  --green: #11a8c9;
  --pink: #07182f;
  --accent: #11a8c9;
  --danger: #b42318;
  --gradient-main: linear-gradient(115deg, #07182f 0%, #0a4f8f 42%, #0d7ee8 74%, #11a8c9 100%);
  --shadow: 0 22px 55px rgba(10, 32, 70, 0.14);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Plus Jakarta Sans", Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(10, 79, 143, 0.09), transparent 32%),
    radial-gradient(circle at top right, rgba(13, 126, 232, 0.12), transparent 34%),
    linear-gradient(180deg, #ffffff 0%, #f4f8ff 35%, #f7fbff 100%);
}

button,
input {
  font: inherit;
}

.shell {
  min-height: 100vh;
}

.hero {
  min-height: 620px;
  padding: 18px clamp(18px, 4vw, 64px) 54px;
  background:
    linear-gradient(115deg, rgba(255, 255, 255, 0.96) 0%, rgba(244, 248, 255, 0.92) 28%, rgba(233, 244, 255, 0.78) 52%, rgba(218, 238, 255, 0.72) 70%, rgba(225, 249, 252, 0.7) 100%),
    radial-gradient(circle at 18% 16%, rgba(10, 79, 143, 0.16), transparent 30%),
    radial-gradient(circle at 82% 10%, rgba(13, 126, 232, 0.22), transparent 34%),
    url("../../img/fibra-detalle.jpg?v=20260429-2209") center/cover;
  color: var(--ink);
}

.topbar,
.hero-grid,
.result {
  max-width: 1160px;
  margin: 0 auto;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 82px;
}

.brand {
  color: inherit;
  font-size: 1.2rem;
  font-weight: 800;
  text-decoration: none;
}

.brand.logo {
  width: 260px;
  max-width: 62vw;
  height: 72px;
  overflow: hidden;
  flex: 0 0 auto;
}

.brand.logo img {
  display: block;
  width: 260px;
  max-width: 100%;
  height: 72px;
  object-fit: contain;
  object-position: left center;
}

.secure-pill,
.trust-row span {
  border: 1px solid rgba(255, 255, 255, 0.45);
  border-radius: 999px;
  padding: 9px 14px;
  background: rgba(255, 255, 255, 0.76);
  backdrop-filter: blur(12px);
  font-weight: 700;
  font-size: 0.88rem;
  color: var(--brand);
  box-shadow: 0 10px 30px rgba(105, 92, 187, 0.12);
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(360px, 0.95fr);
  gap: 42px;
  align-items: center;
  padding-top: 70px;
}

.intro h1 {
  margin: 8px 0 12px;
  font-size: clamp(3.8rem, 7vw, 6.6rem);
  line-height: 0.92;
  letter-spacing: 0;
  color: #101a2f;
}

.intro p {
  max-width: 600px;
  margin: 0;
  color: #324266;
  font-size: 1.18rem;
  line-height: 1.65;
}

.eyebrow {
  background: var(--gradient-main);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.trust-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 28px;
}

.lookup-panel {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(124, 58, 237, 0.12);
  border-radius: 8px;
  padding: 28px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.panel-heading {
  display: flex;
  gap: 16px;
  align-items: flex-start;
}

.step {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--gradient-main);
  color: #fff;
  font-weight: 800;
  flex: 0 0 auto;
}

.panel-heading h2,
.section-title h3,
.side-panel h3 {
  margin: 0;
  font-size: 1.25rem;
}

.panel-heading p,
.helper,
.side-panel p,
.invoice-card p {
  color: var(--muted);
  margin: 5px 0 0;
  line-height: 1.5;
}

.rut-form {
  margin-top: 28px;
}

.rut-form label {
  display: block;
  margin-bottom: 8px;
  font-weight: 800;
}

.input-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
}

input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 15px 16px;
  outline: none;
  font-weight: 700;
  color: var(--ink);
  background: #fff;
}

input:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 4px rgba(0, 158, 120, 0.14);
}

.button {
  border: 0;
  border-radius: 8px;
  padding: 14px 18px;
  cursor: pointer;
  font-weight: 800;
  text-decoration: none;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  min-height: 50px;
}

.button:disabled {
  cursor: not-allowed;
  opacity: 0.62;
}

.primary {
  background: linear-gradient(135deg, #ff2d8d 0%, #ff416d 100%);
  color: #fff;
  box-shadow: 0 18px 32px rgba(255, 45, 141, 0.24);
}

.primary:hover {
  background: linear-gradient(135deg, #ed247d 0%, #f23662 100%);
}

.secondary {
  background: linear-gradient(90deg, #7f39fb 0%, #5e39ff 48%, #2f80ff 100%);
  color: #fff;
  box-shadow: 0 16px 32px rgba(74, 68, 255, 0.22);
}

.notice {
  margin-top: 18px;
  border-radius: 8px;
  padding: 13px 14px;
  border: 1px solid #bcd6ff;
  background: #edf5ff;
  color: #17345d;
  font-weight: 700;
}

@supports not (backdrop-filter: blur(18px)) {
  .lookup-panel,
  .secure-pill {
    background: rgba(255, 255, 255, 0.98);
  }
}

.notice.error {
  border-color: #f4b8b2;
  background: #fff0ef;
  color: var(--danger);
}

.result {
  padding: 38px clamp(18px, 4vw, 0px) 70px;
}

.summary-band {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: center;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 24px;
}

.summary-band h2 {
  margin: 6px 0;
  font-size: 1.9rem;
}

.amount-box {
  min-width: 220px;
  background: var(--gradient-main);
  color: #fff;
  border-radius: 8px;
  padding: 18px;
}

.amount-box span {
  display: block;
  color: rgba(255, 255, 255, 0.7);
  font-weight: 700;
  margin-bottom: 8px;
}

.amount-box strong {
  font-size: 2rem;
}

.content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 22px;
  margin-top: 22px;
}

.invoices-section,
.side-panel {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 22px;
}

.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.section-title span {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #e6f6f1;
  color: var(--brand-dark);
  font-weight: 800;
}

.invoice-list {
  display: grid;
  gap: 12px;
}

.invoice-card {
  display: grid;
  gap: 14px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.invoice-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.invoice-card strong {
  display: block;
  margin-top: 6px;
  font-size: 1.45rem;
}

.invoice-id {
  color: var(--brand);
  font-weight: 800;
}

.invoice-details {
  border-top: 1px solid var(--line);
  padding-top: 12px;
}

.invoice-details summary {
  cursor: pointer;
  color: var(--brand);
  font-weight: 800;
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.detail-grid div,
.article-row {
  border-radius: 8px;
  background: #f7f8fe;
  border: 1px solid rgba(124, 58, 237, 0.08);
  padding: 12px;
}

.detail-grid span,
.article-row span {
  color: var(--muted);
  display: block;
  line-height: 1.45;
}

.detail-grid strong {
  display: block;
  margin-top: 4px;
}

.article-list {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.article-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
}

.empty-state {
  border: 1px dashed var(--line);
  border-radius: 8px;
  padding: 24px;
  color: var(--muted);
  text-align: center;
}

.service-list {
  display: grid;
  gap: 10px;
  margin: 14px 0;
}

.service-button {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 8px;
  padding: 13px 14px;
  text-align: left;
  font-weight: 800;
  color: var(--ink);
}

.service-button.is-active {
  border-color: var(--brand);
  background: rgba(124, 58, 237, 0.07);
  color: var(--brand);
}

.payment-modal {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  padding: 22px;
  background: rgba(22, 35, 76, 0.42);
  backdrop-filter: blur(10px);
}

.payment-modal[hidden] {
  display: none;
}

.payment-dialog {
  position: relative;
  width: min(560px, 100%);
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid rgba(124, 58, 237, 0.16);
  border-radius: 8px;
  padding: 28px;
  box-shadow: 0 30px 70px rgba(22, 35, 76, 0.24);
}

.payment-dialog h2 {
  margin: 6px 0 8px;
  font-size: 1.65rem;
}

.payment-dialog p {
  margin: 0;
  color: var(--muted);
}

.icon-button {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 38px;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: #fff;
  color: var(--ink);
  cursor: pointer;
  font-size: 1.5rem;
  line-height: 1;
}

.payment-options {
  display: grid;
  gap: 12px;
  margin-top: 22px;
}

.payment-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 16px;
  text-align: left;
}

.payment-option strong,
.payment-option small {
  display: block;
}

.payment-option strong {
  color: var(--ink);
  font-size: 1rem;
}

.payment-option small {
  margin-top: 4px;
  color: var(--muted);
}

.payment-option b {
  color: var(--brand);
  white-space: nowrap;
}

.pay-logo {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  font-weight: 800;
}

.payment-brand-logo {
  display: block;
  width: auto;
  max-width: 74px;
  height: 25px;
  object-fit: contain;
}

.payment-option.is-active {
  cursor: pointer;
  border-color: rgba(10, 79, 143, 0.34);
  box-shadow: 0 14px 30px rgba(10, 79, 143, 0.12);
}

.payment-option:disabled {
  opacity: 0.56;
}

.payment-note {
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.45;
}

.transfer-dialog {
  width: min(720px, 100%);
  max-height: min(92vh, 860px);
  overflow: auto;
}

.transfer-status {
  margin-top: 16px;
  border-radius: 8px;
  padding: 12px 14px;
  background: #edf5ff;
  color: #17345d;
  border: 1px solid #bcd6ff;
  font-weight: 800;
}

.transfer-status[data-status="paid"] {
  background: #e6f6f1;
  border-color: rgba(45, 207, 141, 0.32);
  color: #106347;
}

.transfer-status[data-status="conflict"],
.transfer-status[data-status="expired"] {
  background: #fff0ef;
  border-color: #f4b8b2;
  color: var(--danger);
}

.transfer-amount {
  margin-top: 16px;
  border-radius: 8px;
  padding: 18px;
  background: var(--gradient-main);
  color: #fff;
}

.transfer-amount span,
.transfer-amount small {
  display: block;
  color: rgba(255, 255, 255, 0.78);
  font-weight: 700;
}

.transfer-amount strong {
  display: block;
  margin: 8px 0 6px;
  font-size: 2.4rem;
}

.transfer-warning {
  margin-top: 16px !important;
  border: 1px solid rgba(124, 58, 237, 0.14);
  border-radius: 8px;
  padding: 13px 14px;
  background: rgba(124, 58, 237, 0.06);
  color: #314164 !important;
  font-weight: 700;
}

.bank-box {
  display: grid;
  gap: 9px;
  margin-top: 16px;
}

.bank-row {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 12px;
  align-items: center;
  border: 1px solid rgba(124, 58, 237, 0.1);
  border-radius: 8px;
  padding: 12px;
  background: #f7f8fe;
}

.bank-row span {
  color: var(--muted);
  font-weight: 700;
}

.bank-row strong {
  overflow-wrap: anywhere;
}

.transfer-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 18px;
}

.whatsapp-button {
  background: #25d366;
  border-color: #25d366;
  color: #092e18;
}

.whatsapp-button:hover {
  background: #1fbd5a;
  border-color: #1fbd5a;
}

.admin-page {
  min-height: 100vh;
  padding: 28px;
}

.admin-shell {
  width: min(1180px, 100%);
  margin: 0 auto;
}

.admin-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  margin-top: 20px;
}

.admin-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 20px;
  box-shadow: var(--shadow);
}

.admin-card pre {
  max-height: 460px;
  overflow: auto;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  color: #314164;
}

.receipt-page {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 22px;
}

.receipt {
  width: min(560px, 100%);
}

.receipt .brand {
  color: var(--brand-dark);
}

.receipt-card {
  margin-top: 18px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 30px;
  box-shadow: var(--shadow);
}

.status-dot {
  width: 18px;
  height: 18px;
  display: inline-block;
  border-radius: 50%;
  background: var(--danger);
}

.receipt-card.is-approved .status-dot {
  background: var(--brand);
}

.receipt-note {
  border-radius: 8px;
  background: #edf5ff;
  border: 1px solid #bcd6ff;
  color: #17345d;
  padding: 12px;
}

@media (max-width: 860px) {
  .hero-grid,
  .content-grid {
    grid-template-columns: 1fr;
  }

  .hero {
    padding-bottom: 34px;
  }

  .intro h1 {
    font-size: 4rem;
  }

  .summary-band,
  .invoice-main {
    align-items: stretch;
    flex-direction: column;
  }

  .detail-grid,
  .article-row {
    grid-template-columns: 1fr;
  }

  .amount-box {
    min-width: 0;
  }
}

@media (max-width: 560px) {
  .topbar,
  .input-row {
    align-items: stretch;
    flex-direction: column;
    display: flex;
  }

  .brand.logo {
    width: 220px;
    height: 62px;
  }

  .brand.logo img {
    width: 220px;
    height: 62px;
  }

  .secure-pill {
    width: fit-content;
  }

  .payment-option {
    align-items: stretch;
    flex-direction: column;
  }

  .bank-row,
  .admin-grid {
    grid-template-columns: 1fr;
  }

  .lookup-panel {
    padding: 20px;
  }

  .intro h1 {
    font-size: 3.2rem;
  }
}
