:root {
    color-scheme: light;
    font-family: Inter, "Segoe UI", system-ui, sans-serif;
    color: #192e27;
    background: #f4f6f2;
    line-height: 1.5;
    --ink: #192e27;
    --muted: #50655c;
    --line: #dce5df;
    --green: #215643;
    --rail: #142d25;
    --paper: #fff;
    --badge: #e8f0e9;
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 280px; }
a { color: var(--green); }
h1, h2, h3 { line-height: 1.2; letter-spacing: -.025em; }
button, input, select { font: inherit; }
form { margin: 0; }
:focus-visible { outline: 3px solid #b45723; outline-offset: 4px; }

.skip-link {
    position: fixed;
    z-index: 5;
    inset: .75rem auto auto .75rem;
    padding: .65rem .9rem;
    border-radius: .4rem;
    background: white;
    transform: translateY(-160%);
}
.skip-link:focus { transform: translateY(0); }

.site--member {
    display: grid;
    grid-template-columns: 226px minmax(0, 1fr);
    min-height: 100vh;
}
.portal-rail {
    position: sticky;
    top: 0;
    height: 100vh;
    display: flex;
    flex-direction: column;
    overflow: auto;
    padding: 30px 15px 20px;
    background: var(--rail);
    color: white;
}
.portal-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    color: inherit;
    text-decoration: none;
    white-space: normal;
    line-height: 1.2;
}
.portal-brand img { flex: none; }
.portal-rail .portal-brand { margin: 0 6px 38px; }
.portal-brand strong, .portal-brand small { display: block; }
.portal-brand strong { font-size: .97rem; font-weight: 700; letter-spacing: -.015em; }
.portal-brand small { margin-top: 2px; font-size: .73rem; color: #b7ccc1; }
.portal-brand__mark {
    width: 41px;
    height: 43px;
    flex: none;
    display: grid;
    place-items: center;
    border-radius: 12px;
    background: #d9e9d7;
    color: #204936;
}

.portal-menu { display: grid; gap: 6px; }
.portal-menu__link {
    display: flex;
    align-items: center;
    gap: 11px;
    min-height: 44px;
    padding: 9px 12px;
    color: #c7d9cf;
    border-radius: 9px;
    font-size: .88rem;
    font-weight: 600;
    text-decoration: none;
}
.portal-menu__link:hover { background: #234138; color: white; }
.portal-menu__link.is-current { background: #315145; color: white; }
.portal-menu__link .symbol { flex: none; }
.portal-rail__footer { margin-top: auto; padding-top: 32px; }
.portal-rail__footer .secondary {
    width: 100%;
    justify-content: flex-start;
    color: #ebf3ee;
    border-color: #526e61;
}
.portal-rail__footer .secondary:hover { background: #29483b; }

.portal-workspace { min-width: 0; }
.portal-top { background: #fff; border-bottom: 1px solid var(--line); }
.portal-top__inner {
    min-height: 66px;
    max-width: 1320px;
    margin: auto;
    padding: 8px clamp(20px, 4vw, 52px);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
}
.portal-crumb { display: flex; align-items: center; gap: 11px; font-weight: 650; }
.portal-crumb a, .portal-crumb [aria-hidden] { color: var(--muted); }
.portal-crumb a { text-decoration: none; }
.portal-crumb a:hover { text-decoration: underline; }
.portal-identity {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--green);
    white-space: nowrap;
    font-size: .82rem;
    font-weight: 700;
}
.portal-identity__icon {
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--badge);
}
.portal-identity__icon .symbol { width: 16px; height: 16px; }

.portal-main {
    max-width: 1320px;
    margin: auto;
    padding: clamp(24px, 4vw, 50px) clamp(20px, 4vw, 52px) 52px;
}
.page-title { margin: 0 0 22px; font-size: clamp(1.85rem, 3vw, 2.6rem); }
.portal-hero {
    isolation: isolate;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    min-height: 302px;
    padding: clamp(26px, 5vw, 58px);
    border-radius: 20px;
    background: #16392e;
    color: #fff;
}
.portal-hero::before {
    content: "";
    position: absolute;
    z-index: -1;
    inset: 0;
    background:
        linear-gradient(90deg, #17382e 4%, #17382e 25%, rgba(23, 56, 46, .93) 39%, rgba(23, 56, 46, .44) 68%, rgba(23, 56, 46, .2)),
        url("/portal-media/residencial.webp") right center / cover no-repeat;
}
.portal-hero__copy { max-width: 475px; overflow-wrap: anywhere; }
.portal-hero__copy > p:first-child {
    margin: 0 0 13px;
    color: #c1dbc9;
    font-size: .76rem;
    font-weight: 700;
    letter-spacing: .115em;
    text-transform: uppercase;
}
.portal-hero h1 { margin: 0; font-size: clamp(2.3rem, 5vw, 4.15rem); line-height: 1.02; letter-spacing: -.059em; }
.portal-hero p.portal-hero__name { margin: 17px 0 0; color: #e0ebe4; font-size: .96rem; }

.portal-modules { margin-top: 31px; }
.portal-modules > h2 { font-size: 1.27rem; margin: 0 0 15px; }
.portal-module-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 15px; }
.portal-module {
    position: relative;
    display: grid;
    grid-template-columns: 46px minmax(0, 1fr) 26px;
    align-items: start;
    gap: 13px;
    min-height: 120px;
    padding: 19px 16px;
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: 14px;
    box-shadow: 0 2px 3px #17382e06;
    text-decoration: none;
    color: var(--ink);
    transition: border-color .18s ease, box-shadow .18s ease, translate .18s ease;
}
.portal-module:hover { translate: 0 -2px; border-color: #9eb9a9; box-shadow: 0 9px 22px #17382e12; }
.portal-module__icon {
    display: grid;
    place-items: center;
    width: 46px;
    height: 46px;
    border-radius: 12px;
    background: var(--badge);
    color: var(--green);
}
.portal-module--building .portal-module__icon { color: #355d75; background: #e9f0f5; }
.portal-module--ledger .portal-module__icon { color: #795328; background: #f7ecdd; }
.portal-module--settings .portal-module__icon { color: #594778; background: #f0ecf7; }
.portal-module__icon .symbol { width: 24px; height: 24px; }
.portal-module__body > * { display: block; }
.portal-module__body strong { margin: 1px 0 4px; font-size: 1.06rem; letter-spacing: -.02em; }
.portal-module__body > span { color: var(--muted); font-size: .88rem; }
.portal-module__arrow { display: grid; place-items: center; color: var(--green); margin-top: 8px; }

.symbol {
    display: inline-block;
    width: 19px;
    height: 19px;
    flex: none;
    vertical-align: middle;
    background-color: currentColor;
    mask: var(--symbol) center / contain no-repeat;
}
.symbol--building { --symbol: url("/portal-media/building.png"); }
.symbol--home { --symbol: url("/portal-media/home.png"); }
.symbol--door { --symbol: url("/portal-media/door.png"); }
.symbol--ledger { --symbol: url("/portal-media/ledger.png"); }
.symbol--settings { --symbol: url("/portal-media/settings.png"); }
.symbol--people { --symbol: url("/portal-media/people.png"); }
.symbol--alert { --symbol: url("/portal-media/alert.png"); }
.symbol--car { --symbol: url("/portal-media/car.png"); }
.symbol--logout { --symbol: url("/portal-media/logout.png"); }
.symbol--arrow { --symbol: url("/portal-media/arrow.png"); }
.portal-brand__mark .symbol { width: 23px; height: 23px; }

.card {
    padding: clamp(17px, 2.7vw, 25px);
    margin: 0 0 16px;
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: 14px;
    box-shadow: 0 2px 3px #17382e06;
}
.card h2 { margin: 0 0 14px; font-size: 1.15rem; }
.card p { margin-top: 0; color: var(--muted); }
.card p:last-child { margin-bottom: 0; }
label { display: block; margin: .65rem 0; font-weight: 600; }
input:not([type=checkbox]):not([type=hidden]), select {
    display: block;
    width: 100%;
    max-width: 34rem;
    padding: .62rem .74rem;
    margin: .35rem 0 .8rem;
    border: 1px solid #a6b8ad;
    border-radius: .52rem;
    background: #fff;
    color: var(--ink);
}
input[type=checkbox] { width: 1.05rem; height: 1.05rem; vertical-align: -.16em; accent-color: var(--green); }
button, .button {
    display: inline-flex;
    min-height: 42px;
    align-items: center;
    gap: .55rem;
    padding: .53rem .84rem;
    background: var(--green);
    border: 1px solid transparent;
    border-radius: .52rem;
    color: #fff;
    cursor: pointer;
    font-weight: 650;
    text-decoration: none;
}
button:hover, .button:hover { background: #183f31; }
.secondary { background: transparent; border-color: var(--line); color: var(--green); }
.notice { padding: .8rem 1rem; background: #e7f1e9; border-left: 4px solid var(--green); border-radius: .35rem; }
.card.table { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: .62rem .7rem; text-align: left; border-bottom: 1px solid var(--line); }
thead { color: #324e41; background: #eef3ee; }

.site--guest { min-height: 100vh; background: #e9efe9; }
.site--guest .portal-workspace {
    max-width: 510px;
    margin: 0 auto;
    padding: clamp(34px, 9vh, 110px) 20px 34px;
}
.guest-top { padding: 0 0 23px; }
.guest-top .portal-brand small { color: var(--muted); }
.site--guest .portal-main { padding: 0; }
.site--guest .card { padding: 25px; }

@media (max-width: 1050px) {
    .site--member { grid-template-columns: 202px minmax(0, 1fr); }
    .portal-rail { padding-inline: 12px; }
}
@media (max-width: 860px) {
    .portal-module { min-height: 108px; grid-template-columns: 40px minmax(0, 1fr) 22px; gap: 10px; padding: 15px 13px; }
    .portal-module__icon { width: 40px; height: 40px; }
}
@media (max-width: 720px) {
    .site--member { display: block; }
    .portal-rail {
        position: static;
        height: auto;
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        align-items: start;
        padding: 14px 18px 10px;
        gap: 12px;
    }
    .portal-rail .portal-brand { margin: 0; }
    .portal-rail__footer { padding: 0; grid-column: 2; grid-row: 1; }
    .portal-rail__footer .secondary { min-height: 40px; font-size: .78rem; padding: .45rem .58rem; }
    .portal-rail__footer .symbol { width: 16px; height: 16px; }
    .portal-menu { grid-column: 1 / -1; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 3px; }
    .portal-menu__link { min-height: 37px; padding: 6px 7px; gap: 7px; font-size: .79rem; }
    .portal-menu__link .symbol { width: 15px; height: 15px; }
    .portal-top__inner { min-height: 52px; font-size: .83rem; }
    .portal-hero { min-height: 240px; border-radius: 15px; }
    .portal-hero::before { background-position: center, 65% center; }
}
@media (max-width: 470px) {
    .portal-module-grid { grid-template-columns: 1fr; gap: 10px; }
    .portal-module { min-height: 83px; }
    .portal-top__inner { padding-inline: 18px; }
    .portal-crumb { gap: 5px; }
    .portal-identity { font-size: .73rem; }
    .portal-identity__icon { display: none; }
    .portal-main { padding-inline: 17px; }
    .portal-hero { padding: 23px; min-height: 213px; }
    .portal-hero::before {
        background-image: linear-gradient(90deg, #17382e 4%, rgba(23, 56, 46, .93) 47%, rgba(23, 56, 46, .42)), url("/portal-media/residencial.webp");
    }
    .portal-hero h1 { font-size: 2.22rem; }
}
@media (prefers-reduced-motion: reduce) {
    .portal-module { transition: none; }
}

.unit-fields {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    max-width: 34rem;
}
.unit-fields label { margin-bottom: 0; }
.access-switch {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4px;
    margin-bottom: 17px;
    padding: 4px;
    border: 1px solid var(--line);
    border-radius: 9px;
    background: #eef3ee;
}
.access-switch a {
    padding: 8px 5px;
    border-radius: 6px;
    font-size: .84rem;
    font-weight: 650;
    text-align: center;
    text-decoration: none;
}
.access-switch a[aria-current="page"] { background: #fff; box-shadow: 0 1px 3px #17382e20; }
.access-switch a:hover { text-decoration: underline; }
.access-reset { margin-top: 19px; padding-top: 17px; border-top: 1px solid var(--line); }
.access-reset h3 { margin: 0 0 12px; font-size: 1rem; }
.access-accounts { margin: 15px 0; padding: 0; list-style: none; }
.access-accounts li { display: flex; flex-wrap: wrap; gap: 5px 12px; padding: .65rem; border-bottom: 1px solid var(--line); }
.access-accounts span { color: var(--muted); }
@media (max-width: 375px) {
    .unit-fields { grid-template-columns: 1fr; gap: 0; }
}

.profile-vehicle { padding: .7rem 0; border-bottom: 1px solid var(--line); }
.profile-vehicle summary { cursor: pointer; font-weight: 750; }
.profile-vehicle summary small { margin-left: .45rem; color: var(--muted); font-weight: 500; }
.profile-vehicle form { margin-top: .7rem; }
.profile-vehicle .secondary { color: #80392f; }
.profile-vehicle .secondary:hover { background: #fff1ee; }

.portal-owner-details { margin: 24px 0 0; }
.portal-owner-details__heading {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: 8px 16px;
}
.portal-owner-details__heading h2 { margin: 0; }
.portal-owner-details__heading a { font-size: .88rem; font-weight: 650; text-underline-offset: 3px; }
.portal-owner-details__heading .symbol { width: 14px; height: 14px; }
.portal-owner-details dl {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 205px), 1fr));
    gap: 12px;
    margin: 16px 0 0;
}
.portal-owner-details dl > div {
    min-width: 0;
    padding: 10px 12px;
    border-radius: 8px;
    background: #eff4ef;
}
.portal-owner-details dt { color: var(--muted); font-size: .8rem; }
.portal-owner-details dd { margin: 4px 0 0; font-weight: 650; overflow-wrap: anywhere; }
.portal-owner-details dd.portal-owner-details__missing { color: var(--muted); font-weight: 400; }

.porteria-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: start;
    gap: 16px;
}
.porteria-grid #placa { text-transform: uppercase; }
.card .porteria-contact-notice { margin-top: 16px; }
.porteria-address { margin: 20px 0 8px; font-size: 1rem; }
.porteria-contacts { list-style: none; margin: 0; padding: 0; }
.porteria-contacts li {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 8px 12px;
    padding: 10px 0;
    border-top: 1px solid var(--line);
}
.porteria-contacts span { display: block; color: var(--muted); font-size: .88rem; }
.porteria-contacts .button { font-size: .82rem; }
.porteria-result {
    margin-top: 16px;
    padding: 13px 15px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #edf3ed;
}
.porteria-result.fondo-verde { background: #285442; }
.porteria-result.fondo-amarillo { background: #ffefbf; }
.porteria-result.fondo-naranja { background: #7b4113; }
.porteria-result.fondo-rojo { background: #73342c; }
.porteria-result button { margin: 0 6px 5px 0; }
@media (max-width: 900px) { .porteria-grid { grid-template-columns: 1fr; } }

.portal-privacy { max-width:1320px; margin:auto; padding: 0 clamp(20px,4vw,52px) 20px; font-size:.85rem; }
.card textarea { width:100%; max-width:40rem; display:block; padding:.65rem; margin:.35rem 0 .85rem; border:1px solid #a6b8ad; border-radius:.52rem; font:inherit; }
.contact-buttons { display:flex; flex-wrap:wrap; gap:8px; margin-bottom:8px; }

.cuotas-year { padding: 16px 0; border-top: 1px solid var(--line); }
.cuotas-year:last-child { padding-bottom:0; }
.cuotas-year__head { display:flex; flex-wrap:wrap; gap:8px 22px; align-items:baseline; margin-bottom:10px; }
.cuotas-year__head h3,.cuotas-year__head p { margin:0; }
.cuotas-year__head h3 { font-size:1.2rem; }
.cuotas-month-grid { display:grid; grid-template-columns:repeat(6,minmax(0,1fr)); gap:8px; margin:0; padding:0; list-style:none; }
.cuotas-month { display:grid; place-content:center; text-align:center; min-height:54px; padding:6px 2px; border-radius:8px; border:1px solid #c99799; color:#8c2028; overflow-wrap:anywhere; }
.cuotas-month--pagado { background:#e3eee7; border-color:#9bb8a7; color:#254d39; }
.cuotas-month--pendiente { background:#fbe7e7; border-color:#ca7c82; }
.cuotas-month--futuro { background:#fff; }
.cuotas-month span { font-size:.73rem; }
@media (max-width:680px) { .cuotas-month-grid { grid-template-columns:repeat(3,minmax(0,1fr)); } }
