:root {
    --auth-font: Inter, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    --auth-ink: #12211c;
    --auth-muted: #607069;
    --auth-line: #dce4df;
    --auth-surface: #ffffff;
    --auth-green: #0d654a;
    --auth-green-dark: #084533;
    --auth-gold: #c9a34f;
    --auth-danger: #b42318;
    --auth-focus: #156fbb;
    --auth-shadow: 0 24px 64px rgba(16, 38, 31, 0.13);
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    min-width: 320px;
    color-scheme: light;
    font-family: var(--auth-font);
    text-size-adjust: 100%;
}

body {
    margin: 0;
    color: var(--auth-ink);
    font-family: var(--auth-font);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

button,
input {
    color: inherit;
    font: inherit;
}

button,
a {
    -webkit-tap-highlight-color: transparent;
}

a {
    color: inherit;
}

img,
svg {
    display: block;
}

svg {
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.8;
}

[hidden] {
    display: none !important;
}

.auth-sr-only {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

.auth-skip-link {
    position: fixed;
    inset-block-start: 0.75rem;
    inset-inline-start: 0.75rem;
    z-index: 100;
    padding: 0.75rem 1rem;
    border-radius: 0.65rem;
    background: #ffffff;
    color: #0a4936;
    font-size: 0.875rem;
    font-weight: 750;
    text-decoration: none;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
    transform: translateY(-150%);
    transition: transform 160ms ease;
}

.auth-skip-link:focus {
    transform: translateY(0);
    outline: 3px solid var(--auth-focus);
    outline-offset: 2px;
}

/* Portal-specific login pages */
.portal-auth {
    min-height: 100vh;
    min-height: 100svh;
    background: #f7f6f1;
}

.portal-auth__main,
.portal-auth__shell {
    min-height: 100vh;
    min-height: 100svh;
}

.portal-auth__shell {
    display: grid;
    grid-template-columns: minmax(34rem, 47%) minmax(0, 1fr);
}

.portal-auth__content {
    position: relative;
    z-index: 2;
    min-width: 0;
    background:
        radial-gradient(circle at 0 0, rgba(201, 163, 79, 0.1), transparent 25rem),
        #f8f7f2;
}

.portal-auth--backoffice .portal-auth__content {
    grid-column: 2;
    grid-row: 1;
    background:
        linear-gradient(rgba(255, 255, 255, 0.68), rgba(255, 255, 255, 0.68)),
        repeating-linear-gradient(135deg, rgba(15, 64, 49, 0.045) 0 1px, transparent 1px 14px),
        #eef2ef;
}

.portal-auth__content-inner {
    display: flex;
    flex-direction: column;
    width: 100%;
    min-height: 100%;
    padding: clamp(1.25rem, 2.2vw, 2rem) clamp(1.35rem, 4.2vw, 4.5rem);
}

.portal-auth__topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.portal-auth__brand {
    display: inline-flex;
    align-items: center;
    gap: 0.8rem;
    min-width: 0;
    color: var(--auth-ink);
    text-decoration: none;
}

.portal-auth__brand > img {
    width: clamp(6.7rem, 9vw, 8.25rem);
    height: auto;
    flex: 0 0 auto;
}

.portal-auth__brand > span {
    display: grid;
    gap: 0.05rem;
    padding-inline-start: 0.8rem;
    border-inline-start: 1px solid #ced8d2;
    line-height: 1.25;
}

.portal-auth__brand strong {
    color: #0a513b;
    font-size: 0.96rem;
    letter-spacing: 0.09em;
}

.portal-auth__brand small {
    overflow: hidden;
    color: var(--auth-muted);
    font-size: 0.68rem;
    font-weight: 650;
    letter-spacing: 0.025em;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.portal-auth__back {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    min-height: 2.75rem;
    padding: 0.55rem 0.75rem;
    border-radius: 0.7rem;
    color: #42514b;
    font-size: 0.78rem;
    font-weight: 700;
    text-decoration: none;
    transition: background-color 160ms ease, color 160ms ease;
}

.portal-auth__back svg {
    width: 1rem;
    height: 1rem;
    transition: transform 160ms ease;
}

.portal-auth__back:hover {
    background: rgba(13, 101, 74, 0.08);
    color: #0a513b;
}

.portal-auth__back:hover svg {
    transform: translateX(-0.15rem);
}

.portal-auth__body {
    display: flex;
    flex: 1 0 auto;
    flex-direction: column;
    justify-content: center;
    width: min(100%, 32.5rem);
    margin: 0 auto;
    padding: clamp(2.5rem, 6vh, 5.75rem) 0 clamp(2rem, 4vh, 3.5rem);
}

.auth-card {
    position: relative;
    overflow: hidden;
    padding: clamp(1.5rem, 3.3vw, 2.4rem);
    border: 1px solid rgba(13, 82, 61, 0.13);
    border-radius: 1.5rem;
    background: rgba(255, 255, 255, 0.98);
    box-shadow: var(--auth-shadow);
}

.auth-card::before {
    position: absolute;
    inset: 0 0 auto;
    height: 0.25rem;
    background: linear-gradient(90deg, var(--auth-green), #3b987a 62%, var(--auth-gold));
    content: "";
}

.portal-auth--backoffice .auth-card {
    border-color: rgba(25, 48, 40, 0.17);
    border-radius: 1rem;
    box-shadow: 0 24px 54px rgba(10, 30, 24, 0.16);
}

.portal-auth--backoffice .auth-card::before {
    background: linear-gradient(90deg, #ba8f36, #e0c477 42%, #9b752b);
}

.auth-card__heading {
    margin-block-end: 1.7rem;
}

.auth-context-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin-block-end: 1.05rem;
    padding: 0.4rem 0.7rem;
    border: 1px solid rgba(13, 101, 74, 0.16);
    border-radius: 999px;
    background: #edf8f3;
    color: #0a5b42;
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 0.085em;
    line-height: 1;
    text-transform: uppercase;
}

.auth-context-badge > span {
    width: 0.45rem;
    height: 0.45rem;
    border-radius: 50%;
    background: #1b8f67;
    box-shadow: 0 0 0 0.22rem rgba(27, 143, 103, 0.12);
}

.portal-auth--backoffice .auth-context-badge {
    border-color: rgba(155, 117, 43, 0.2);
    background: #f8f2e4;
    color: #79591d;
}

.portal-auth--backoffice .auth-context-badge > span {
    background: #b88c34;
    box-shadow: 0 0 0 0.22rem rgba(184, 140, 52, 0.12);
}

.auth-card__heading h1 {
    margin: 0;
    color: #11221c;
    font-size: clamp(1.65rem, 3vw, 2.15rem);
    font-weight: 760;
    letter-spacing: -0.035em;
    line-height: 1.12;
}

.auth-card__heading p {
    max-width: 29rem;
    margin: 0.7rem 0 0;
    color: var(--auth-muted);
    font-size: 0.91rem;
    line-height: 1.65;
}

.auth-alert {
    display: grid;
    grid-template-columns: 1.15rem minmax(0, 1fr);
    gap: 0.65rem;
    margin-block-end: 1.15rem;
    padding: 0.8rem 0.9rem;
    border: 1px solid;
    border-radius: 0.75rem;
    font-size: 0.79rem;
    line-height: 1.5;
}

.auth-alert > svg {
    width: 1.15rem;
    height: 1.15rem;
    margin-block-start: 0.08rem;
}

.auth-alert strong {
    display: block;
    margin-block-end: 0.15rem;
}

.auth-alert ul {
    margin: 0.2rem 0 0;
    padding-inline-start: 1.05rem;
}

.auth-alert--success {
    border-color: #b7dfce;
    background: #edf9f4;
    color: #176249;
}

.auth-alert--info {
    border-color: #bbd9ec;
    background: #eff8fd;
    color: #155d87;
}

.auth-alert--warning {
    border-color: #ead39f;
    background: #fff8e8;
    color: #785716;
}

.auth-alert--error {
    border-color: #f0b5ae;
    background: #fff3f1;
    color: #8f2118;
}

.auth-form {
    display: grid;
    gap: 1.1rem;
}

.auth-field {
    min-width: 0;
}

.auth-field label,
.auth-field__label-row label {
    display: inline-block;
    margin-block-end: 0.45rem;
    color: #25352f;
    font-size: 0.78rem;
    font-weight: 760;
}

.auth-field__label-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.auth-field__label-row a {
    margin-block-end: 0.45rem;
    color: #0b684c;
    font-size: 0.75rem;
    font-weight: 760;
    text-underline-offset: 0.2rem;
}

.portal-auth--backoffice .auth-field__label-row a {
    color: #76581e;
}

.auth-input-wrap {
    position: relative;
    display: flex;
    align-items: center;
    min-width: 0;
    border: 1px solid #cfdad4;
    border-radius: 0.75rem;
    background: #fbfcfb;
    color: #75827c;
    transition: border-color 150ms ease, box-shadow 150ms ease, background-color 150ms ease;
}

.auth-input-wrap:hover {
    border-color: #9fb3aa;
    background: #ffffff;
}

.auth-input-wrap:focus-within {
    border-color: var(--auth-green);
    background: #ffffff;
    box-shadow: 0 0 0 0.22rem rgba(13, 101, 74, 0.12);
}

.portal-auth--backoffice .auth-input-wrap:focus-within {
    border-color: #8c6a26;
    box-shadow: 0 0 0 0.22rem rgba(184, 140, 52, 0.14);
}

.auth-input-wrap.is-invalid {
    border-color: #d86257;
    background: #fffafa;
}

.auth-input-wrap.is-invalid:focus-within {
    box-shadow: 0 0 0 0.22rem rgba(180, 35, 24, 0.1);
}

.auth-input-wrap input {
    width: 100%;
    height: 3.35rem;
    min-width: 0;
    padding: 0 3rem 0 2.95rem;
    border: 0;
    outline: 0;
    background: transparent;
    color: #172720;
    font-size: 0.9rem;
}

.auth-input-wrap:not(.auth-input-wrap--password) input {
    padding-inline-end: 1rem;
}

.auth-input-wrap input::placeholder {
    color: #98a49f;
    opacity: 1;
}

.auth-input-icon {
    position: absolute;
    inset-inline-start: 1rem;
    width: 1.15rem;
    height: 1.15rem;
    pointer-events: none;
}

.auth-password-toggle {
    position: absolute;
    inset-inline-end: 0.38rem;
    display: inline-grid;
    width: 2.65rem;
    height: 2.65rem;
    padding: 0;
    place-items: center;
    border: 0;
    border-radius: 0.55rem;
    background: transparent;
    color: #65736d;
    cursor: pointer;
}

.auth-password-toggle:hover {
    background: #edf3ef;
    color: #174e3c;
}

.auth-password-toggle svg {
    width: 1.2rem;
    height: 1.2rem;
}

.auth-field-error {
    display: flex;
    align-items: flex-start;
    gap: 0.35rem;
    margin: 0.45rem 0 0;
    color: var(--auth-danger);
    font-size: 0.74rem;
    font-weight: 600;
    line-height: 1.45;
}

.auth-field-error svg {
    width: 0.95rem;
    height: 0.95rem;
    margin-block-start: 0.05rem;
    flex: 0 0 auto;
}

.auth-checkbox {
    position: relative;
    display: inline-flex;
    width: fit-content;
    min-height: 2.75rem;
    align-items: center;
    gap: 0.65rem;
    color: #56645e;
    font-size: 0.78rem;
    cursor: pointer;
}

.auth-checkbox > input {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    opacity: 0;
}

.auth-checkbox__control {
    display: inline-grid;
    width: 1.15rem;
    height: 1.15rem;
    flex: 0 0 auto;
    place-items: center;
    border: 1px solid #b7c5be;
    border-radius: 0.3rem;
    background: #ffffff;
    color: #ffffff;
    transition: border-color 140ms ease, background-color 140ms ease, box-shadow 140ms ease;
}

.auth-checkbox__control svg {
    width: 0.82rem;
    height: 0.82rem;
    opacity: 0;
    stroke-width: 2.5;
}

.auth-checkbox input:checked + .auth-checkbox__control {
    border-color: var(--auth-green);
    background: var(--auth-green);
}

.portal-auth--backoffice .auth-checkbox input:checked + .auth-checkbox__control {
    border-color: #8c6a26;
    background: #8c6a26;
}

.auth-checkbox input:checked + .auth-checkbox__control svg {
    opacity: 1;
}

.auth-checkbox input:focus-visible + .auth-checkbox__control {
    outline: 3px solid rgba(21, 111, 187, 0.34);
    outline-offset: 2px;
}

.auth-submit {
    position: relative;
    display: inline-flex;
    width: 100%;
    min-height: 3.35rem;
    align-items: center;
    justify-content: center;
    gap: 0.65rem;
    padding: 0.85rem 1.15rem;
    overflow: hidden;
    border: 1px solid transparent;
    border-radius: 0.75rem;
    background: linear-gradient(135deg, #0c6549, #084b37);
    box-shadow: 0 10px 22px rgba(8, 75, 55, 0.2);
    color: #ffffff;
    font-size: 0.84rem;
    font-weight: 800;
    letter-spacing: 0.01em;
    cursor: pointer;
    transition: transform 150ms ease, box-shadow 150ms ease, filter 150ms ease;
}

.auth-submit::before {
    position: absolute;
    inset: 0;
    background: linear-gradient(110deg, transparent 28%, rgba(255, 255, 255, 0.13) 48%, transparent 68%);
    content: "";
    transform: translateX(-120%);
    transition: transform 420ms ease;
}

.auth-submit > * {
    position: relative;
    z-index: 1;
}

.auth-submit > svg {
    width: 1.05rem;
    height: 1.05rem;
    transition: transform 150ms ease;
}

.auth-submit:hover:not(:disabled) {
    box-shadow: 0 14px 28px rgba(8, 75, 55, 0.28);
    filter: saturate(1.08);
    transform: translateY(-1px);
}

.auth-submit:hover:not(:disabled)::before {
    transform: translateX(120%);
}

.auth-submit:hover:not(:disabled) > svg {
    transform: translateX(0.15rem);
}

.portal-auth--backoffice .auth-submit {
    border-color: #183e32;
    border-radius: 0.6rem;
    background: linear-gradient(135deg, #173d32, #102b24);
    box-shadow: 0 10px 22px rgba(16, 43, 36, 0.22);
}

.auth-submit:disabled {
    cursor: wait;
    opacity: 0.78;
}

.auth-submit__spinner {
    display: none;
    width: 1rem;
    height: 1rem;
    border: 2px solid rgba(255, 255, 255, 0.42);
    border-top-color: #ffffff;
    border-radius: 50%;
    animation: auth-spin 650ms linear infinite;
}

.auth-submit[aria-busy="true"] .auth-submit__spinner {
    display: inline-block;
}

.auth-submit[aria-busy="true"] > svg {
    display: none;
}

.auth-security-note {
    display: grid;
    grid-template-columns: 1.8rem minmax(0, 1fr);
    gap: 0.65rem;
    margin-block-start: 1.35rem;
    padding-block-start: 1.15rem;
    border-block-start: 1px solid #e4ebe7;
}

.auth-security-note > svg {
    width: 1.55rem;
    height: 1.55rem;
    padding: 0.25rem;
    border-radius: 0.45rem;
    background: #edf6f2;
    color: #126248;
}

.portal-auth--backoffice .auth-security-note > svg {
    background: #f7f1e3;
    color: #8b6825;
}

.auth-security-note p {
    display: grid;
    gap: 0.1rem;
    margin: 0;
}

.auth-security-note strong {
    color: #3d4c46;
    font-size: 0.72rem;
}

.auth-security-note span {
    color: #74817c;
    font-size: 0.67rem;
    line-height: 1.5;
}

.auth-switch {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-block-start: 1rem;
    padding: 0.85rem 1rem;
    border: 1px solid rgba(13, 82, 61, 0.12);
    border-radius: 0.8rem;
    background: rgba(255, 255, 255, 0.72);
}

.auth-switch p {
    margin: 0;
    color: #65736d;
    font-size: 0.7rem;
}

.auth-switch a {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    flex: 0 0 auto;
    color: #0b684c;
    font-size: 0.7rem;
    font-weight: 800;
    text-decoration: none;
}

.portal-auth--backoffice .auth-switch a {
    color: #74551b;
}

.auth-switch a:hover {
    text-decoration: underline;
    text-underline-offset: 0.2rem;
}

.auth-switch svg {
    width: 0.9rem;
    height: 0.9rem;
}

.auth-registration {
    margin: 0.9rem 0 0;
    color: #68756f;
    font-size: 0.72rem;
    text-align: center;
}

.auth-registration a {
    color: #0a6449;
    font-weight: 800;
    text-underline-offset: 0.2rem;
}

.portal-auth__footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding-block-start: 1rem;
    border-block-start: 1px solid rgba(72, 94, 85, 0.12);
    color: #718079;
    font-size: 0.67rem;
}

.portal-auth__footer a {
    color: #365248;
    font-weight: 750;
    text-underline-offset: 0.2rem;
}

.portal-auth__visual {
    position: relative;
    grid-column: 2;
    grid-row: 1;
    min-width: 0;
    min-height: 100%;
    overflow: hidden;
    isolation: isolate;
    background: #12382d;
    color: #ffffff;
}

.portal-auth--backoffice .portal-auth__visual {
    grid-column: 1;
    background: #122820;
}

.portal-auth__visual-image,
.portal-auth__visual-shade {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

.portal-auth__visual-image {
    z-index: -3;
    object-fit: cover;
    object-position: 58% center;
    transform: scale(1.015);
}

.portal-auth--backoffice .portal-auth__visual-image {
    object-position: 66% center;
}

.portal-auth__visual-shade {
    z-index: -2;
    background:
        linear-gradient(180deg, rgba(5, 22, 17, 0.32), rgba(5, 24, 18, 0.08) 35%, rgba(5, 25, 19, 0.91) 100%),
        linear-gradient(90deg, rgba(5, 30, 22, 0.52), transparent 70%);
}

.portal-auth--backoffice .portal-auth__visual-shade {
    background:
        linear-gradient(180deg, rgba(8, 22, 17, 0.55), rgba(8, 22, 17, 0.12) 36%, rgba(8, 22, 17, 0.94) 100%),
        linear-gradient(90deg, rgba(8, 24, 18, 0.45), transparent 70%);
}

.portal-auth__visual::after {
    position: absolute;
    inset: 0;
    z-index: -1;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
    background-size: 4rem 4rem;
    content: "";
    mask-image: linear-gradient(to bottom, black, transparent 75%);
    pointer-events: none;
}

.portal-auth__visual-brand {
    position: absolute;
    inset-block-start: clamp(1.8rem, 4vw, 3.5rem);
    inset-inline-start: clamp(2rem, 5vw, 5rem);
    padding: 0.7rem 0.85rem;
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 0.75rem;
    background: rgba(5, 30, 22, 0.28);
    backdrop-filter: blur(8px);
}

.portal-auth__visual-brand img {
    width: clamp(7.5rem, 11vw, 10.5rem);
    height: auto;
}

.portal-auth__visual-copy {
    position: absolute;
    inset-inline: clamp(2rem, 5vw, 5rem);
    inset-block-end: clamp(5.75rem, 11vh, 8.5rem);
    max-width: 38rem;
}

.portal-auth__visual-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    margin-block-end: 1rem;
    color: #f0d998;
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.portal-auth__visual-eyebrow::before {
    width: 1.7rem;
    height: 1px;
    background: currentColor;
    content: "";
}

.portal-auth__visual-copy h2 {
    max-width: 35rem;
    margin: 0;
    color: #ffffff;
    font-size: clamp(2rem, 4vw, 3.7rem);
    font-weight: 720;
    letter-spacing: -0.045em;
    line-height: 1.05;
    text-wrap: balance;
}

.portal-auth__visual-copy > p {
    max-width: 35rem;
    margin: 1rem 0 0;
    color: rgba(255, 255, 255, 0.82);
    font-size: clamp(0.9rem, 1.25vw, 1.05rem);
    line-height: 1.7;
}

.portal-auth__visual-points {
    display: flex;
    flex-wrap: wrap;
    gap: 0.7rem;
    margin: 1.6rem 0 0;
    padding: 0;
    list-style: none;
}

.portal-auth__visual-points li {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.5rem 0.7rem;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 999px;
    background: rgba(5, 30, 22, 0.32);
    color: rgba(255, 255, 255, 0.92);
    font-size: 0.68rem;
    font-weight: 650;
    backdrop-filter: blur(8px);
}

.portal-auth__point-icon {
    display: inline-grid;
    width: 1rem;
    height: 1rem;
    place-items: center;
    border-radius: 50%;
    background: rgba(228, 198, 118, 0.18);
    color: #f0d998;
}

.portal-auth__point-icon svg {
    width: 0.7rem;
    height: 0.7rem;
    stroke-width: 2.4;
}

.portal-auth__visual-foot {
    position: absolute;
    inset-inline: clamp(2rem, 5vw, 5rem);
    inset-block-end: 2rem;
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    color: rgba(255, 255, 255, 0.64);
    font-size: 0.65rem;
    font-weight: 650;
    letter-spacing: 0.03em;
}

.portal-auth__status-dot {
    width: 0.45rem;
    height: 0.45rem;
    border-radius: 50%;
    background: #dfbf6e;
    box-shadow: 0 0 0 0.25rem rgba(223, 191, 110, 0.14);
}

/* Legacy /login access gateway */
.auth-gateway-page {
    min-height: 100vh;
    min-height: 100svh;
    background:
        radial-gradient(circle at 8% 0, rgba(21, 118, 84, 0.11), transparent 28rem),
        radial-gradient(circle at 92% 12%, rgba(201, 163, 79, 0.14), transparent 24rem),
        #f3f5f1;
}

.auth-gateway-page::before {
    position: fixed;
    inset: 0;
    z-index: -1;
    background-image:
        linear-gradient(rgba(16, 64, 49, 0.035) 1px, transparent 1px),
        linear-gradient(90deg, rgba(16, 64, 49, 0.035) 1px, transparent 1px);
    background-size: 4rem 4rem;
    content: "";
    mask-image: linear-gradient(to bottom, black, transparent 82%);
}

.auth-gateway__header {
    border-block-end: 1px solid rgba(33, 65, 54, 0.12);
    background: rgba(250, 251, 248, 0.8);
    backdrop-filter: blur(14px);
}

.auth-gateway__header-inner {
    display: flex;
    width: min(100% - 2.5rem, 73rem);
    min-height: 5.5rem;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin: 0 auto;
}

.portal-auth__brand--gateway > img {
    width: 7.5rem;
}

.portal-auth__back--gateway {
    color: #415049;
}

.auth-gateway {
    width: min(100% - 2.5rem, 73rem);
    margin: 0 auto;
    padding: clamp(3.25rem, 7vh, 6rem) 0 2.5rem;
}

.auth-gateway__intro {
    max-width: 47rem;
    margin: 0 auto clamp(2.25rem, 5vh, 3.75rem);
    text-align: center;
}

.auth-gateway__eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    margin-block-end: 0.9rem;
    color: #0c6549;
    font-size: 0.72rem;
    font-weight: 850;
    letter-spacing: 0.13em;
    text-transform: uppercase;
}

.auth-gateway__eyebrow::before,
.auth-gateway__eyebrow::after {
    width: 1.8rem;
    height: 1px;
    background: #b69545;
    content: "";
}

.auth-gateway__intro h1 {
    margin: 0;
    color: #10251e;
    font-size: clamp(2.15rem, 5vw, 4rem);
    font-weight: 760;
    letter-spacing: -0.055em;
    line-height: 1.02;
    text-wrap: balance;
}

.auth-gateway__intro p {
    max-width: 41rem;
    margin: 1rem auto 0;
    color: #627169;
    font-size: clamp(0.92rem, 1.5vw, 1.05rem);
    line-height: 1.7;
}

.auth-gateway__grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: clamp(1.25rem, 2.5vw, 2rem);
}

.auth-gateway-card {
    position: relative;
    min-width: 0;
    overflow: hidden;
    border: 1px solid rgba(25, 61, 49, 0.15);
    border-radius: 1.4rem;
    background: #ffffff;
    box-shadow: 0 18px 48px rgba(16, 46, 36, 0.09);
    color: #182821;
    text-decoration: none;
    transition: transform 190ms ease, box-shadow 190ms ease, border-color 190ms ease;
}

.auth-gateway-card:hover {
    border-color: rgba(13, 101, 74, 0.3);
    box-shadow: 0 28px 64px rgba(16, 46, 36, 0.16);
    transform: translateY(-0.35rem);
}

.auth-gateway-card--backoffice:hover {
    border-color: rgba(160, 120, 42, 0.4);
}

.auth-gateway-card__media {
    position: relative;
    height: clamp(12rem, 22vw, 15rem);
    overflow: hidden;
    background: #153d31;
}

.auth-gateway-card__media::after {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, transparent 38%, rgba(6, 29, 22, 0.8));
    content: "";
}

.auth-gateway-card__media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: 59% center;
    transition: transform 600ms cubic-bezier(0.2, 0.65, 0.3, 1);
}

.auth-gateway-card--backoffice .auth-gateway-card__media img {
    object-position: 64% center;
}

.auth-gateway-card:hover .auth-gateway-card__media img {
    transform: scale(1.035);
}

.auth-gateway-card__media > span {
    position: absolute;
    inset-inline-start: 1.15rem;
    inset-block-end: 1rem;
    z-index: 1;
    padding: 0.4rem 0.65rem;
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: 999px;
    background: rgba(6, 32, 24, 0.42);
    color: rgba(255, 255, 255, 0.92);
    font-size: 0.67rem;
    font-weight: 750;
    backdrop-filter: blur(7px);
}

.auth-gateway-card__body {
    display: grid;
    grid-template-columns: 3.2rem minmax(0, 1fr);
    gap: 1rem;
    padding: clamp(1.3rem, 3vw, 2rem);
}

.auth-gateway-card__icon {
    display: inline-grid;
    width: 3.2rem;
    height: 3.2rem;
    place-items: center;
    border-radius: 0.9rem;
    background: #eaf6f1;
    color: #0d654a;
}

.auth-gateway-card--backoffice .auth-gateway-card__icon {
    background: #f5efdf;
    color: #876621;
}

.auth-gateway-card__icon svg {
    width: 1.45rem;
    height: 1.45rem;
}

.auth-gateway-card__label {
    display: block;
    margin-block-end: 0.35rem;
    color: #0d654a;
    font-size: 0.67rem;
    font-weight: 850;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.auth-gateway-card--backoffice .auth-gateway-card__label {
    color: #806021;
}

.auth-gateway-card h2 {
    margin: 0;
    color: #162820;
    font-size: clamp(1.25rem, 2.2vw, 1.65rem);
    font-weight: 750;
    letter-spacing: -0.03em;
    line-height: 1.2;
}

.auth-gateway-card p {
    margin: 0.7rem 0 0;
    color: #68766f;
    font-size: 0.82rem;
    line-height: 1.65;
}

.auth-gateway-card__action {
    display: flex;
    grid-column: 1 / -1;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-block-start: 0.3rem;
    padding-block-start: 1rem;
    border-block-start: 1px solid #e7ece9;
    color: #0c6248;
    font-size: 0.77rem;
    font-weight: 820;
}

.auth-gateway-card--backoffice .auth-gateway-card__action {
    color: #75591f;
}

.auth-gateway-card__action svg {
    width: 1.05rem;
    height: 1.05rem;
    transition: transform 160ms ease;
}

.auth-gateway-card:hover .auth-gateway-card__action svg {
    transform: translateX(0.2rem);
}

.auth-gateway__help {
    display: grid;
    grid-template-columns: 2.6rem minmax(0, 1fr) auto;
    gap: 0.85rem;
    align-items: center;
    margin-block-start: clamp(1.5rem, 4vh, 2.5rem);
    padding: 1rem 1.15rem;
    border: 1px solid rgba(29, 70, 56, 0.12);
    border-radius: 1rem;
    background: rgba(255, 255, 255, 0.7);
}

.auth-gateway__help-icon {
    display: inline-grid;
    width: 2.6rem;
    height: 2.6rem;
    place-items: center;
    border-radius: 0.75rem;
    background: #e8f3ee;
    color: #176148;
}

.auth-gateway__help-icon svg {
    width: 1.25rem;
    height: 1.25rem;
}

.auth-gateway__help p {
    display: grid;
    gap: 0.1rem;
    margin: 0;
    color: #68766f;
    font-size: 0.72rem;
}

.auth-gateway__help strong {
    color: #31463d;
    font-size: 0.78rem;
}

.auth-gateway__help > a {
    display: inline-flex;
    min-height: 2.75rem;
    align-items: center;
    padding: 0.6rem 0.85rem;
    border: 1px solid #b9c9c1;
    border-radius: 0.65rem;
    color: #174e3c;
    font-size: 0.72rem;
    font-weight: 800;
    text-decoration: none;
}

.auth-gateway__help > a:hover {
    border-color: #6f9787;
    background: #f4faf7;
}

.auth-gateway__footer {
    display: flex;
    width: min(100% - 2.5rem, 73rem);
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin: 0 auto;
    padding: 1.25rem 0 2rem;
    border-block-start: 1px solid rgba(33, 65, 54, 0.1);
    color: #738078;
    font-size: 0.67rem;
}

@keyframes auth-spin {
    to {
        transform: rotate(360deg);
    }
}

@media (max-width: 1180px) {
    .portal-auth__shell {
        grid-template-columns: minmax(31rem, 52%) minmax(0, 1fr);
    }

    .portal-auth__brand > span {
        display: none;
    }

    .portal-auth__visual-copy h2 {
        font-size: clamp(2rem, 4.2vw, 3.1rem);
    }

    .portal-auth__visual-points {
        display: grid;
        justify-items: start;
    }
}

@media (max-width: 900px) {
    .portal-auth__shell {
        display: flex;
        flex-direction: column;
    }

    .portal-auth__content,
    .portal-auth--backoffice .portal-auth__content {
        order: 1;
    }

    .portal-auth__visual,
    .portal-auth--backoffice .portal-auth__visual {
        order: 2;
        min-height: 25rem;
    }

    .portal-auth__content-inner {
        min-height: 100vh;
        min-height: 100svh;
    }

    .portal-auth__visual-copy {
        inset-block-end: 5.8rem;
    }

    .portal-auth__visual-points {
        display: flex;
    }
}

@media (max-width: 760px) {
    .auth-gateway__grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .auth-gateway-card__media {
        height: 13rem;
    }

    .auth-gateway__help {
        grid-template-columns: 2.6rem minmax(0, 1fr);
    }

    .auth-gateway__help > a {
        grid-column: 2;
        justify-self: start;
    }
}

@media (max-width: 560px) {
    .portal-auth__content-inner {
        padding: 1rem;
    }

    .portal-auth__topbar {
        align-items: flex-start;
    }

    .portal-auth__brand > img,
    .portal-auth__brand--gateway > img {
        width: 6.4rem;
    }

    .portal-auth__back {
        padding-inline: 0.55rem;
    }

    .portal-auth__back span {
        max-width: 7rem;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .portal-auth__body {
        padding-block: 2.25rem 1.5rem;
    }

    .auth-card {
        padding: 1.35rem 1.15rem;
        border-radius: 1.05rem;
        box-shadow: 0 18px 44px rgba(16, 38, 31, 0.12);
    }

    .auth-card__heading {
        margin-block-end: 1.4rem;
    }

    .auth-card__heading h1 {
        font-size: 1.65rem;
    }

    .auth-switch {
        align-items: flex-start;
        flex-direction: column;
        gap: 0.45rem;
    }

    .portal-auth__footer {
        align-items: flex-start;
        flex-direction: column;
        gap: 0.35rem;
    }

    .portal-auth__visual,
    .portal-auth--backoffice .portal-auth__visual {
        min-height: 28rem;
    }

    .portal-auth__visual-brand {
        inset-block-start: 1.5rem;
        inset-inline-start: 1.25rem;
    }

    .portal-auth__visual-copy {
        inset-inline: 1.25rem;
        inset-block-end: 5.25rem;
    }

    .portal-auth__visual-copy h2 {
        font-size: 2rem;
    }

    .portal-auth__visual-points li:nth-child(3) {
        display: none;
    }

    .portal-auth__visual-foot {
        inset-inline: 1.25rem;
        inset-block-end: 1.5rem;
    }

    .auth-gateway__header-inner,
    .auth-gateway,
    .auth-gateway__footer {
        width: min(100% - 2rem, 73rem);
    }

    .auth-gateway__header-inner {
        min-height: 4.75rem;
    }

    .portal-auth__brand--gateway > span {
        display: none;
    }

    .portal-auth__back--gateway span {
        max-width: none;
    }

    .auth-gateway {
        padding-block-start: 3rem;
    }

    .auth-gateway__intro {
        margin-block-end: 2rem;
    }

    .auth-gateway__intro h1 {
        font-size: 2.35rem;
    }

    .auth-gateway-card {
        border-radius: 1.05rem;
    }

    .auth-gateway-card__media {
        height: 11.5rem;
    }

    .auth-gateway-card__body {
        grid-template-columns: 2.8rem minmax(0, 1fr);
        padding: 1.2rem;
    }

    .auth-gateway-card__icon {
        width: 2.8rem;
        height: 2.8rem;
    }

    .auth-gateway__help {
        grid-template-columns: 2.4rem minmax(0, 1fr);
        padding: 0.9rem;
    }

    .auth-gateway__help-icon {
        width: 2.4rem;
        height: 2.4rem;
    }

    .auth-gateway__footer {
        align-items: flex-start;
        flex-direction: column;
        gap: 0.3rem;
    }
}

@media (max-width: 370px) {
    .portal-auth__back span,
    .portal-auth__back--gateway span {
        display: none;
    }

    .auth-card {
        padding-inline: 1rem;
    }

    .auth-input-wrap input {
        font-size: 0.84rem;
    }

    .auth-gateway-card__body {
        grid-template-columns: 1fr;
    }

    .auth-gateway-card__icon {
        grid-row: auto;
    }

    .auth-gateway-card__action {
        grid-column: 1;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

@media (forced-colors: active) {
    .auth-context-badge,
    .auth-security-note > svg,
    .auth-gateway-card__icon,
    .auth-gateway__help-icon {
        border: 1px solid CanvasText;
    }

    .auth-submit,
    .auth-checkbox input:checked + .auth-checkbox__control {
        border-color: ButtonText;
    }
}

.portal-auth__back:focus-visible,
.portal-auth__brand:focus-visible,
.auth-field__label-row a:focus-visible,
.auth-password-toggle:focus-visible,
.auth-submit:focus-visible,
.auth-switch a:focus-visible,
.auth-registration a:focus-visible,
.portal-auth__footer a:focus-visible,
.auth-gateway-card:focus-visible,
.auth-gateway__help > a:focus-visible {
    outline: 3px solid var(--auth-focus);
    outline-offset: 3px;
}

[dir="rtl"] .portal-auth__back svg,
[dir="rtl"] .auth-submit > svg,
[dir="rtl"] .auth-switch svg,
[dir="rtl"] .auth-gateway-card__action svg {
    transform: rotate(180deg);
}
