:root {
    --navy: #092d60;
    --blue: #0a57c7;
    --teal: #0796a6;
    --text: #17345f;
    --muted: #526886;
    --line: #dce4ed;
    --card-shadow: 0 14px 38px rgba(22, 51, 91, .09);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body { min-width: 320px; background: radial-gradient(circle at 58% 38%, #f8fbfd 0, #fff 48%); color: var(--text); font-family: 'Poppins', Arial, sans-serif; }
a { color: inherit; }

.site-header { position: sticky; top: 0; z-index: 100; width: 100%; border-bottom: 2px solid rgba(7, 150, 166, .22); background: rgba(242, 248, 251, .96); box-shadow: 0 5px 20px rgba(9, 45, 96, .06); backdrop-filter: blur(10px); }
.page-shell { min-height: calc(100vh - 284px); max-width: 1400px; margin: 0 auto; padding: 50px 52px 112px; }
.brand-header { display: flex; align-items: center; }
.brand-header { width: 100%; max-width: 1400px; min-height: 108px; margin: 0 auto; padding: 18px 52px; }
.brand { display: inline-flex; align-items: center; gap: 13px; color: var(--navy); text-decoration: none; }
.brand-logo { display: block; width: 62px; height: 62px; object-fit: contain; }
.brand-copy { display: block; line-height: 1; white-space: nowrap; }
.brand-copy strong { display: block; font-size: 24px; font-weight: 500; letter-spacing: -.5px; }
.brand-copy small { display: block; margin-top: 8px; font-size: 9px; font-weight: 600; letter-spacing: 4px; }
.brand-divider { width: 1px; height: 58px; margin: 0 27px 0 34px; background: #6e7f98; }
.brand-header p { font-size: 15px; line-height: 1.55; }

.portal-layout { display: grid; grid-template-columns: 1.08fr .98fr .98fr; gap: 48px; align-items: stretch; }
.welcome { align-self: center; padding: 50px 6px 30px; }
.eyebrow { margin-bottom: 20px; color: var(--teal); font-size: 14px; font-weight: 600; letter-spacing: .2px; }
.welcome h1 { color: var(--navy); font-size: clamp(34px, 2.8vw, 45px); line-height: 1.28; letter-spacing: -1.5px; }
.welcome h1 span { display: block; color: var(--teal); }
.title-line { display: block; width: 60px; height: 2px; margin: 30px 0 35px; background: var(--teal); }
.intro { max-width: 440px; color: var(--muted); font-size: 16px; line-height: 1.75; }

.access-card { position: relative; min-height: 482px; overflow: hidden; border-radius: 13px; background: rgba(255,255,255,.98); padding: 34px 27px; box-shadow: var(--card-shadow); }
.client-card, .invoice-card { display: flex; flex-direction: column; }
.corner { position: absolute; top: 0; left: 0; width: 22px; height: 30px; border-radius: 0 0 7px 0; }
.corner-teal { background: linear-gradient(135deg, #087a82, #09aeb6); }
.corner-blue { background: linear-gradient(135deg, #0741a2, #0876dc); }
.card-heading { display: flex; align-items: flex-start; gap: 17px; }
.icon-wrap { display: grid; flex: 0 0 73px; width: 73px; height: 73px; place-items: center; border-radius: 50%; background: linear-gradient(135deg, #f4faff, #e6f3f7); color: var(--teal); }
.icon-wrap svg { width: 43px; height: 43px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.card-heading h2 { margin-top: 14px; color: var(--navy); font-size: 20px; line-height: 1.25; letter-spacing: -.4px; }
.card-heading p { margin-top: 10px; color: var(--text); font-size: 13px; line-height: 1.7; }

.portal-frame { position: relative; flex: 0 0 155px; height: 155px; margin: auto 14px 0; overflow: hidden; border: 1px solid var(--line); border-radius: 5px; background: #fff; }
/* El formulario remoto tiene medidas fijas muy pequeñas. Se amplía y centra
   dentro de la tarjeta sin modificar ni capturar las credenciales. */
.portal-frame iframe { position: absolute; top: 11px; left: 50%; display: block; width: 220px; height: 132px; border: 0; transform: translateX(-50%) scale(.92); transform-origin: top center; }
.security-note { display: flex; align-items: center; gap: 13px; margin: 24px 0 0; border-radius: 8px; background: #f2f8fc; padding: 12px 14px; }
.security-icon { display: grid; flex: 0 0 43px; width: 43px; height: 43px; place-items: center; border-radius: 50%; background: #eef5fb; color: #176ac2; }
.security-icon svg { width: 25px; height: 25px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.security-note strong { display: block; color: var(--navy); font-size: 12px; }
.security-note p { max-width: 240px; margin-top: 3px; color: var(--muted); font-size: 10px; line-height: 1.5; }
.portal-benefits { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 14px; margin: 16px 4px 0; list-style: none; }
.portal-benefits li { position: relative; padding-left: 17px; color: var(--muted); font-size: 10px; line-height: 1.45; }
.portal-benefits li::before { content: '✓'; position: absolute; left: 0; color: var(--teal); font-weight: 700; }
.portal-benefits li:last-child { grid-column: 1 / -1; }
.benefits { margin: 42px 0 28px; list-style: none; }
.benefits li { position: relative; margin: 0 0 21px; padding-left: 35px; color: var(--text); font-size: 13px; line-height: 1.55; }
.benefits li::before { content: '✓'; position: absolute; left: 3px; top: -2px; color: var(--teal); font-size: 22px; font-weight: 600; }
.primary-button { display: block; width: 100%; margin-top: auto; border-radius: 6px; background: linear-gradient(135deg, #079392, #0b9cac); padding: 17px 12px; color: #fff; font-size: 15px; font-weight: 600; text-align: center; text-decoration: none; box-shadow: 0 8px 20px rgba(7, 147, 146, .16); transition: transform .2s ease, box-shadow .2s ease; }
.primary-button:hover, .primary-button:focus-visible { transform: translateY(-2px); box-shadow: 0 11px 24px rgba(7, 147, 146, .26); }

.site-footer { min-height: 138px; background: linear-gradient(120deg, #052e5d, #062957 70%, #072b5c); color: #fff; }
.footer-inner { width: 100%; max-width: 1400px; margin: auto; padding: 30px 52px 18px; display: grid; grid-template-columns: repeat(5, auto); justify-content: center; align-items: center; gap: 0; }
.footer-logo-link { display: flex; align-items: center; gap: 11px; padding-right: 22px; color: #fff; text-decoration: none; }
.footer-logo { display: block; width: 55px; height: 55px; object-fit: contain; filter: brightness(0) invert(1); }
.footer-brand-copy { display: block; line-height: 1; white-space: nowrap; }
.footer-brand-copy strong { display: block; font-size: 21px; font-weight: 500; }
.footer-brand-copy small { display: block; margin-top: 7px; font-size: 8px; font-weight: 600; letter-spacing: 3.5px; }
.footer-item { min-height: 40px; display: flex; align-items: center; gap: 10px; border-left: 1px solid rgba(255,255,255,.34); padding: 0 25px; color: #fff; font-size: 12px; text-decoration: none; white-space: nowrap; }
.footer-icon { color: #d9f5fb; font-size: 20px; }
.location-icon { display: grid; flex: 0 0 22px; width: 22px; height: 22px; place-items: center; }
.location-icon svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.copyright { padding: 0 20px 14px; font-size: 10px; text-align: center; opacity: .86; }

@media (max-width: 1180px) {
    .brand-header { padding-left: 35px; padding-right: 35px; }
    .page-shell { padding: 45px 35px 75px; }
    .portal-layout { grid-template-columns: 1fr 1fr; gap: 28px; }
    .welcome { grid-column: 1 / -1; padding: 15px 0 20px; text-align: center; }
    .welcome br { display: none; }
    .title-line { margin-left: auto; margin-right: auto; }
    .intro { margin: auto; }
    .footer-inner { grid-template-columns: repeat(2, 1fr); gap: 18px; }
    .footer-logo-link { grid-column: 1 / -1; padding: 0; }
    .footer-item { border-left: 0; padding: 0; }
}

@media (max-width: 760px) {
    .site-header { position: sticky; }
    .page-shell { padding: 34px 18px 48px; }
    .brand-header { min-height: 82px; justify-content: center; padding: 12px 18px; }
    .brand-divider, .brand-header > p { display: none; }
    .brand-logo { width: 54px; height: 54px; }
    .brand-copy strong { font-size: 21px; }
    .portal-layout { grid-template-columns: 1fr; gap: 22px; }
    .welcome { grid-column: auto; padding: 12px 5px 20px; }
    .welcome h1 { font-size: 32px; letter-spacing: -1px; }
    .intro { font-size: 15px; }
    .access-card { min-height: auto; padding: 30px 20px; }
    .card-heading { gap: 13px; }
    .icon-wrap { flex-basis: 60px; width: 60px; height: 60px; }
    .icon-wrap svg { width: 35px; height: 35px; }
    .card-heading h2 { margin-top: 8px; font-size: 19px; }
    .portal-frame { margin-left: 0; margin-right: 0; }
    .portal-frame iframe { transform: translateX(-50%) scale(.88); }
    .site-footer { min-height: 250px; }
    .footer-inner { grid-template-columns: 1fr; padding: 30px 22px 18px; gap: 13px; text-align: center; }
    .footer-logo-link { grid-column: auto; }
    .footer-logo-link { justify-content: center; }
    .footer-item { min-height: 30px; justify-content: center; }
}

@media (prefers-reduced-motion: reduce) {
    * { scroll-behavior: auto !important; transition: none !important; }
}
