:root {
    color-scheme: light;
    --paper: #f4f6f8;
    --surface: #ffffff;
    --ink: #17202a;
    --muted: #66717e;
    --rule: #d9dee5;
    --green: #147d64;
    --green-dark: #0d5c49;
    --red: #b54343;
    --finance: #1f6f78;
    --patrimony: #8c5b2d;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: var(--paper);
    color: var(--ink);
}

button,
input {
    font: inherit;
}

.portal-shell {
    min-height: 100vh;
}

.portal-frame {
    width: min(1080px, calc(100% - 48px));
    margin: 0 auto;
    padding: 72px 0 32px;
}

.portal-header {
    max-width: 680px;
    margin-bottom: 42px;
}

.suite-mark {
    display: grid;
    width: 38px;
    grid-template-columns: repeat(2, 14px);
    gap: 4px;
    margin-bottom: 24px;
}

.suite-mark span {
    aspect-ratio: 1;
    border-radius: 3px;
    background: var(--ink);
}

.suite-mark span:nth-child(2),
.suite-mark span:nth-child(3) {
    background: var(--green);
}

.eyebrow {
    margin: 0 0 10px;
    color: var(--green-dark);
    font-size: 13px;
    font-weight: 750;
    text-transform: uppercase;
}

h1,
h2,
p {
    margin-top: 0;
}

h1 {
    margin-bottom: 12px;
    font-size: 52px;
    line-height: 1.05;
    letter-spacing: 0;
}

.portal-header > p:last-child,
.auth-description,
.service-card p {
    color: var(--muted);
    line-height: 1.6;
}

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

.service-card {
    display: flex;
    min-height: 285px;
    flex-direction: column;
    padding: 28px;
    border: 1px solid var(--rule);
    border-radius: 8px;
    background: var(--surface);
}

.service-card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 30px;
}

.service-symbol {
    display: grid;
    width: 42px;
    aspect-ratio: 1;
    place-items: center;
    border-radius: 7px;
    background: var(--finance);
    color: #fff;
    font-size: 19px;
    font-weight: 800;
}

.service-symbol-patrimonio {
    background: var(--patrimony);
}

.service-card h2 {
    margin-bottom: 8px;
    font-size: 22px;
}

.service-card p {
    flex: 1;
}

.status-label,
.service-strip span {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 650;
}

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

.status-dot.online {
    background: var(--green);
}

.primary-button {
    display: inline-flex;
    min-height: 44px;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--ink);
    border-radius: 6px;
    background: var(--ink);
    color: #fff;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
}

.primary-button:hover {
    background: #2c3742;
}

.primary-button:disabled,
.service-offline .primary-button {
    border-color: var(--rule);
    background: #e6e9ed;
    color: #8a939d;
    cursor: not-allowed;
}

.portal-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 28px 2px 0;
    color: var(--muted);
    font-size: 13px;
}

.text-button {
    border: 0;
    background: none;
    color: var(--ink);
    font-weight: 700;
    cursor: pointer;
}

.auth-layout {
    display: grid;
    min-height: 100vh;
    grid-template-columns: minmax(0, 1fr) minmax(420px, 560px);
}

.auth-context {
    display: flex;
    min-height: 100vh;
    flex-direction: column;
    justify-content: center;
    padding: 64px max(48px, 8vw);
    background: #e8eef0;
}

.auth-context h1 {
    max-width: 650px;
}

.auth-description {
    max-width: 560px;
}

.auth-panel {
    display: grid;
    min-width: 0;
    place-items: center;
    padding: 48px;
    background: var(--surface);
}

.auth-form {
    display: grid;
    width: min(100%, 420px);
    gap: 18px;
}

.link-form {
    width: min(100%, 470px);
}

fieldset {
    display: grid;
    gap: 14px;
    margin: 0;
    padding: 18px;
    border: 1px solid var(--rule);
    border-radius: 7px;
}

legend {
    padding: 0 7px;
    font-size: 13px;
    font-weight: 750;
}

.field {
    display: grid;
    gap: 7px;
    color: #3d4854;
    font-size: 13px;
    font-weight: 650;
}

.field input {
    width: 100%;
    min-height: 44px;
    border: 1px solid #bdc5ce;
    border-radius: 6px;
    background: #fff;
    padding: 9px 11px;
    color: var(--ink);
}

.field input:focus {
    border-color: var(--green);
    outline: 3px solid rgba(20, 125, 100, .14);
}

.feedback {
    border-left: 3px solid var(--red);
    background: #fff1f1;
    padding: 11px 13px;
    color: #842d2d;
    font-size: 13px;
    line-height: 1.45;
}

.service-strip {
    display: flex;
    gap: 18px;
    margin-top: 22px;
}

.fatal-state,
.loading-state {
    display: grid;
    min-height: 100vh;
    place-content: center;
    justify-items: start;
    padding: 32px;
}

.fatal-state {
    gap: 14px;
}

@media (max-width: 820px) {
    .portal-frame {
        width: min(100% - 28px, 620px);
        padding-top: 36px;
    }

    .service-grid,
    .auth-layout {
        grid-template-columns: 1fr;
    }

    .auth-context {
        min-height: auto;
        padding: 34px 24px;
    }

    .auth-context h1 {
        font-size: 34px;
    }

    .auth-panel {
        padding: 32px 20px 48px;
    }
}

@media (max-width: 460px) {
    .service-card {
        min-height: 260px;
        padding: 22px;
    }

    .portal-footer {
        align-items: flex-start;
        flex-direction: column;
        gap: 14px;
    }
}
