/* 
===============================================
Tokens
===============================================
*/

:root {
    --primary-color: #1d4f91;
    --primary-foreground-color: #ffffff;
    --primary-hover-color: #164179;

    --secondary-color: #c1188b;
    --secondary-foreground-color: #ffffff;
    --secondary-hover-color: #a11473;

    --background-color: #ffffff;
    --background-subtle-color: #f4f5f8;
    --background-hover-color: #f8f9fd;

    --subtle-color: #666666;
    --border-color: #d1d1d1;

    --bullet-color-1: #632678;
    --bullet-color-2: #982881;
    --bullet-color-3: #ba2f7d;

    --section-max-width: 100rem;
    --header-height: 5rem;
    --subheader-height: 3.25rem;
}

/* 
===============================================
Base
===============================================
*/

html, body {
    scroll-behavior: smooth;
    font-family: 'Roboto', 'Inter', sans-serif;
    font-size: 16px;
}

/*
===============================================
Hero header (redesigned pages only)

Header/subheader/footer styling (including making the header and
signed-in subheader fixed/sticky) lives in site-header.css, loaded by
_Layout.cshtml for every page. That file also adds a top padding to
<body> so legacy page content clears the fixed header.

This page is one of the redesigned ones (it has a full-bleed hero
section), so instead of being pushed down it needs its hero to run
behind the transparent/see-through header - cancel that padding and
offset the hero section itself instead.
===============================================
*/

body {
    padding-top: 0;
}

/* The signed-in header is opaque (not see-through like the anon hero header),
   so the cover section needs to start below it instead of running behind it.
   nav.subheader is only rendered for signed-in pages, so its presence in the
   DOM (regardless of whether it's visually hidden on mobile) is what flags a
   signed-in page here. */
body:has(> nav.subheader) section:first-child {
    margin-top: var(--header-height);
    height: calc(100vh - var(--header-height));
}

body:has(> nav.subheader) section {
    scroll-margin-top: var(--header-height);
}

/* On top of that, the subheader itself takes up another --subheader-height
   on desktop, where it's actually visible. (The rule that hides header's own
   tab links on desktop, and hides the subheader on mobile, lives once in
   site-header.css.) */
@media (min-width: 768px) {
    body:has(> nav.subheader) section:first-child {
        margin-top: calc(var(--header-height) + var(--subheader-height));
        height: calc(100vh - var(--header-height) - var(--subheader-height));
    }

    body:has(> nav.subheader) section {
        scroll-margin-top: calc(var(--header-height) + var(--subheader-height));
    }
}

/*
===============================================
Layout
===============================================
*/

main {
    padding: 0;
    margin: 0;
    width: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.column::before,
.column::after,
.row::before,
.row::after {
    content: none;
    display: none;
}

.column {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    gap: 2rem;
    max-width: var(--section-max-width);
    flex: 1;
    margin: 0;
    height: 100%;
}

.row {
    display: flex;
    flex-direction: row;
    align-items: center;
    flex: 1;
    justify-content: space-between;
    max-width: var(--section-max-width);
    margin: 0;
    gap: 8rem;
    height: 100%;
}

section {
    scroll-margin-top: var(--header-height);
    margin: 0;
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    width: 100%;
    height: calc(100vh - var(--header-height));
    max-height: 40rem;
    padding: 4rem;
    gap: 4rem;
}

section img {
    height: 18rem;
    width: auto;
    max-width: 100%;
    aspect-ratio: 284 / 137;
    align-self: flex-start;
    border-radius: 0.25rem;
    border: 1px solid var(--border-color);
    overflow: hidden;
    display: block;
    flex-shrink: 0;
    object-fit: cover;
    object-position: top right;
}

section a {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--primary-color);
    text-decoration: none;
}

section a:hover {
    color: var(--primary-hover-color);
    text-decoration: underline;
}

section:nth-of-type(odd):not(.hero) {
    background-color: var(--background-subtle-color);
}

@media (min-width: 768px) {
    section:nth-of-type(odd):not(.hero) .row {
        flex-direction: row-reverse;
    }
}

section:first-child {
    height: 100vh;
}

section.hero {
    position: relative;
    isolation: isolate;
    overflow: hidden;
}

section.hero > img.hero-cover {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    max-width: none;
    aspect-ratio: auto;
    align-self: stretch;
    border: 0;
    border-radius: 0;
    object-fit: cover;
    object-position: right top;
    z-index: 0;
    pointer-events: none;
}

section.hero::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, rgba(255, 255, 255, 0.97), rgba(255, 255, 255, 0));
    z-index: 1;
    pointer-events: none;
}

section.hero > .column {
    position: relative;
    z-index: 2;
}

a.scroll-down {
    position: absolute;
    bottom: 2rem;
    left: 50%;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 3rem;
    height: 3rem;
    margin-left: -1.5rem;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.9);
    color: #000;
    box-shadow: 0 0 0.5rem 0 rgba(0, 0, 0, 0.2);
    text-decoration: none;
    animation: float 2s ease-in-out infinite;
    transition: background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

a.scroll-down:hover {
    background: var(--secondary-color);
    color: var(--secondary-foreground-color);
    box-shadow: 0 0.25rem 1rem 0 rgba(0, 0, 0, 0.25);
    text-decoration: none;
}

/* 
===============================================
Typography
===============================================
*/

ul {
    margin: 0;
    padding: 0;
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

ul li {
    color: #000;
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
}

ul li::before {
    content: '';
    flex-shrink: 0;
    width: 0.625rem;
    height: 0.625rem;
    margin-top: 0.55em;
    border-radius: 0.15rem;
    background-color: var(--bullet);
}

li:nth-child(3n + 1) { --bullet: var(--bullet-color-1); }
li:nth-child(3n + 2) { --bullet: var(--bullet-color-2); }
li:nth-child(3n)     { --bullet: var(--bullet-color-3); }

h1,
h2 {
    font-weight: 500;
    color: #000;
    margin: 0;
    padding: 0;
    line-height: 1.2;
    display: inline-block;
}

h1 {
    font-size: 3rem;
    letter-spacing: -0.01em;
}

h2 {
    font-size: 2rem;
}

p {
    font-size: 1rem;
    font-weight: 400;
    color: #000;
    margin: 0;
    padding: 0;
    line-height: 1.8em;
}

p.subtle {
    font-size: 0.875rem;
    line-height: 1.4;
    color: var(--subtle-color);
}

a {
    outline-color: var(--secondary-color) !important;
}

/* 
===============================================
Buttons
===============================================
*/

button {
    font-size: 0.9rem;
    font-weight: 500;
    color: #000;
    margin: 0;
    padding: 0 1.2rem;
    height: 2.8rem;
    display: flex;
    align-items: center;
    line-height: 1.5;
    border-radius: 0.25rem;
    border: 0;
    cursor: pointer;
    outline-color: var(--secondary-color);
    transition: background-color 0.1s ease-in-out, box-shadow 0.1s ease-in-out, transform 0.1s ease-in-out;
    box-shadow: 0 0 0.5rem 0 rgba(0, 0, 0, 0.25);
}

button:hover {
    box-shadow: 0 4px 1rem 0 rgba(0, 0, 0, 0.25);
}

button:active {
    box-shadow: 0 0 0.5rem 0 rgba(0, 0, 0, 0.25);
    transform: translateY(1px);
}

button span {
    margin: 0 0.4rem;
    font-size: inherit;
}

button.primary {
    background-color: var(--primary-color);
    color: var(--primary-foreground-color);
    fill: #fff;
}

button.primary:hover {
    background-color: var(--primary-hover-color);
}

/* Link styled as a button - used where the action navigates (e.g. the
   signed-in hero's "go to my letters" CTA) rather than opening a modal. */
a.cta-button {
    font-size: 0.9rem;
    font-weight: 500;
    margin: 0;
    padding: 0 1.2rem;
    height: 2.8rem;
    display: inline-flex;
    align-items: center;
    line-height: 1.5;
    border-radius: 0.25rem;
    text-decoration: none;
    cursor: pointer;
    box-shadow: 0 0 0.5rem 0 rgba(0, 0, 0, 0.25);
    transition: background-color 0.1s ease-in-out, box-shadow 0.1s ease-in-out, transform 0.1s ease-in-out;
}

a.cta-button:hover {
    box-shadow: 0 4px 1rem 0 rgba(0, 0, 0, 0.25);
}

a.cta-button:active {
    box-shadow: 0 0 0.5rem 0 rgba(0, 0, 0, 0.25);
    transform: translateY(1px);
}

a.cta-button.primary {
    background-color: var(--primary-color);
    color: var(--primary-foreground-color);
}

a.cta-button.primary:hover {
    background-color: var(--primary-hover-color);
    color: var(--primary-foreground-color);
}

button.wide {
    width: 100%;
    justify-content: center;
    gap: 0.5rem;
}

button.wide:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

button.is-loading {
    position: relative;
    opacity: 0.7;
    pointer-events: none;
    cursor: not-allowed;
}

button.is-loading > span:not(.loading-dots) {
    visibility: hidden;
}

button.is-loading .loading-dots {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.3rem;
    margin: 0;
}

button.is-loading .loading-dots span {
    width: 0.4rem;
    height: 0.4rem;
    margin: 0;
    border-radius: 50%;
    background: currentColor;
    animation: bounce 1.2s ease-in-out infinite;
}

button.is-loading .loading-dots span:nth-child(2) {
    animation-delay: 0.15s;
}

button.is-loading .loading-dots span:nth-child(3) {
    animation-delay: 0.3s;
}

/* 
===============================================
Badges
===============================================
*/

.secure-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    margin: 0;
    padding: 0.375rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--primary-color);
    background: rgba(29, 79, 145, 0.08);
    border-radius: 2rem;
    width: fit-content;
}

.secure-badge svg {
    width: 0.875rem;
    height: 0.875rem;
    flex-shrink: 0;
}

.trust-notice {
    margin: 0;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
    text-align: center;
    font-size: 0.8125rem;
    line-height: 1.5;
}

/* The .badge used for the header's "Welcome <name>" chip is defined once,
   scoped to header, in site-header.css. */

/*
===============================================
Forms
===============================================
*/

.field {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    width: 100%;
}

.field label {
    font-size: 0.875rem;
    font-weight: 500;
    color: #000;
}

.input {
    position: relative;
    display: grid;
    outline-color: var(--primary-color) !important;
    width: 100%;
}

.input input {
    grid-area: 1 / 1;
    box-sizing: border-box;
    width: 100%;
    max-width: none;
    height: 2.8rem;
    margin: 0;
    padding: 0 2.5rem 0 1rem;
    border: 1px solid var(--primary-color);
    border-radius: 0.25rem;
    font-size: 1rem;
    font-family: inherit;
    color: #000;
    background: var(--background-color);
}

.input input:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 0;
}

.input input:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: #f5f5f5;
}

.input-icon {
    grid-area: 1 / 1;
    justify-self: end;
    align-self: center;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 1rem;
    color: var(--primary-color);
    pointer-events: none;
}

.input-icon svg {
    width: 1.125rem;
    height: 1.125rem;
    display: block;
    flex-shrink: 0;
}

/* 
===============================================
Accordion
===============================================
*/

.accordion {
    height: auto;
    max-height: none;
    flex-direction: column;
    align-items: stretch;
}

.accordion .column {
    width: 100%;
    gap: 2rem;
    margin: 0 auto;
}

.accordion .accordion {
    display: flex;
    flex-direction: column;
    width: 100%;
    margin-bottom: 3rem;
}

.accordion .accordion-item {
    border-bottom: 1px solid var(--border-color);
}

.accordion .accordion-nested {
    padding-left: 1.5rem;
}

.accordion .accordion-group > .accordion-nested:last-child {
    border-bottom: none;
}

.accordion .accordion-group {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.2s ease-out;
    margin-bottom: 0;
    border: none;
    border-radius: 0;
}

.accordion button.accordion-trigger {
    width: 100%;
    text-align: left;
    background: none;
    border: none;
    box-shadow: none;
    height: auto;
    min-height: 2.8rem;
    padding: 0.75rem 0rem;
    color: var(--primary-color);
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    text-decoration: none;
}

.accordion button.accordion-trigger:hover {
    color: var(--primary-hover-color);
    text-decoration: underline;
    box-shadow: none;
    background-color: var(--background-hover-color);
}

.accordion button.accordion-trigger::after {
    content: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' aria-hidden='true' class='svg-icon iconArrowDownAlt' width='18' height='18' viewBox='0 0 18 18'%3E%3Cpath d='M16.01 7.38 14.6 5.97 9 11.55 3.41 5.95 2.01 7.36l7 7z'/%3E%3C/svg%3E ");
    color: var(--primary-color);
    font-size: 1.25rem;
    font-weight: 400;
    flex-shrink: 0;
    text-decoration: none;
    transition: transform 0.2s ease-in-out;
}

.accordion button.accordion-trigger.active::after {
    transform: rotate(-180deg);
}

.accordion .accordion-panel {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.2s ease-out;
    color: #000;
    line-height: 1.8;
}

.accordion .accordion-panel::after {
    content: '';
    display: block;
    height: 2rem;
}

/* 
===============================================
Modal steps
===============================================
*/

nav.modal-steps {
    --step-marker-size: 1.375rem;
    --step-marker-font-size: 0.6875rem;
    --step-marker-border-width: 1.5px;
    --step-label-font-size: 0.625rem;
    --step-item-gap: 0.375rem;
    --step-connector-height: 1px;

    width: 100%;
    margin: 0;
}

nav.modal-steps ol {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0;
    position: relative;
    width: 100%;
    margin: 0;
    padding: 0;
    list-style: none;
}

nav.modal-steps ol::before {
    content: '';
    display: block;
    position: absolute;
    top: calc(var(--step-marker-size) / 2);
    transform: translateY(-50%);
    left: calc(var(--step-marker-size) / 2);
    right: calc(var(--step-marker-size) / 2);
    height: var(--step-connector-height);
    background: var(--border-color);
    z-index: 0;
    pointer-events: none;
}

nav.modal-steps ol li {
    position: relative;
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--step-item-gap);
    min-width: 0;
    margin: 0;
    padding: 0;
    z-index: 1;
}

nav.modal-steps ol li::before {
    content: none;
    display: none;
}

nav.modal-steps ol li:first-child {
    align-items: flex-start;
}

nav.modal-steps ol li:first-child .modal-steps__label {
    text-align: left;
}

nav.modal-steps ol li:last-child {
    align-items: flex-end;
}

nav.modal-steps ol li:last-child .modal-steps__label {
    text-align: right;
}

nav.modal-steps ol li.is-active .modal-steps__marker,
nav.modal-steps ol li.is-complete .modal-steps__marker {
    border-color: var(--primary-color);
    background: var(--primary-color);
    color: var(--primary-foreground-color);
}

nav.modal-steps ol li.is-active .modal-steps__label {
    color: var(--primary-color);
    font-weight: 600;
}

nav.modal-steps .modal-steps__marker {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    width: var(--step-marker-size);
    height: var(--step-marker-size);
    border-radius: 50%;
    border: var(--step-marker-border-width) solid var(--border-color);
    background: var(--background-color);
    font-size: var(--step-marker-font-size);
    font-weight: 600;
    line-height: 1;
    color: var(--subtle-color);
    flex-shrink: 0;
}

nav.modal-steps .modal-steps__label {
    font-size: var(--step-label-font-size);
    font-weight: 500;
    color: var(--subtle-color);
    text-align: center;
    line-height: 1.2;
    max-width: 100%;
    overflow: visible;
    text-overflow: unset;
    white-space: normal;
    word-break: break-word;
    hyphens: auto;
}

nav.modal-steps.modal-steps--lg {
    --step-marker-size: 2rem;
    --step-marker-font-size: 0.875rem;
    --step-marker-border-width: 2px;
    --step-label-font-size: 0.8125rem;
    --step-item-gap: 0.5rem;
    --step-connector-height: 2px;
}

/* 
===============================================
Dialog
===============================================
*/

.dialog {
    display: flex;
    flex-direction: column;
    background: var(--background-color);
    width: 100%;
    max-width: 100%;
    min-width: 0;
    max-height: calc(100vh - 2rem);
    box-sizing: border-box;
    overflow: hidden;
}

.dialog > .modal-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    width: 100%;
    box-sizing: border-box;
    margin: 0;
    padding: 1.25rem 1.25rem 0;
    flex-shrink: 0;
}

.dialog > .modal-header button {
    background: none;
    border: none;
    box-shadow: none;
    padding: 0;
    width: 2rem;
    height: 2rem;
    font-size: 1.75rem;
    line-height: 1;
    color: #000;
    flex-shrink: 0;
}

.dialog > .modal-header button:hover {
    box-shadow: none;
    color: var(--subtle-color);
}

.dialog img.logo {
    height: 2.2rem;
    width: auto;
    float: none;
    display: block;
    flex-shrink: 0;
}

.dialog > .column {
    width: 100%;
    box-sizing: border-box;
    align-items: stretch;
    gap: 1.5rem;
    max-width: 100%;
    min-width: 0;
    flex: 1 1 auto;
    min-height: 0;
    height: auto;
    padding: 2rem 2rem 6rem;
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.dialog > .column h2 {
    font-size: 1.75rem;
    max-width: 16em;
    margin: 0;
}

.dialog iframe {
    width: 100%;
    border: 0;
}

.dialog .column.login-body {
    padding: 1.25rem 2rem 2rem;
    gap: 1rem;
}

.dialog .column.login-body form {
    display: contents;
}

.dialog .column.login-flow-body {
    flex: 0 0 26rem;
    min-height: 26rem;
    height: 26rem;
}

.dialog .column.login-body h2 {
    font-size: 1.25rem;
}

.dialog .column.login-body .field-label {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--subtle-color);
}

.dialog .column.login-body .field {
    gap: 0.25rem;
}

.dialog .column.login-body nav.modal-steps {
    margin-bottom: 0.5rem;
}

.dialog .column.login-body nav.modal-steps.modal-steps--lg {
    margin-bottom: 0.75rem;
}

.dialog .column.login-body .field-checkbox {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.875rem;
    line-height: 1.4;
    color: #000;
}

.dialog .column.login-body .field-checkbox input[type="checkbox"] {
    margin: 0;
    flex-shrink: 0;
    width: 1rem;
    height: 1rem;
    accent-color: var(--primary-color);
}

.dialog .column.login-body .field-checkbox label {
    font-size: inherit;
    font-weight: 400;
    color: inherit;
}

.dialog .column.login-body .contact-email-field.is-dimmed {
    opacity: 0.5;
}

.dialog .column.login-body .field-textarea textarea,
.dialog .column.login-body .modal-terms-scroll {
    box-sizing: border-box;
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 0.25rem;
    font-size: 0.8125rem;
    line-height: 1.5;
    color: #000;
    background: var(--background-subtle-color);
}

.dialog .column.login-body .field-textarea textarea {
    min-height: 10rem;
    margin: 0;
    font-family: inherit;
    resize: vertical;
}

.dialog .column.login-body .field-textarea textarea:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 0;
}

.dialog .column.login-body .modal-terms-scroll {
    min-height: 12rem;
    max-height: min(20rem, 50vh);
    overflow-y: auto;
}

.dialog .column.login-body .modal-iframe {
    width: 100%;
    min-height: 17.5rem;
}

.dialog .column.login-body .modal-iframe iframe {
    display: block;
    width: 100%;
    min-height: 17.5rem;
    height: 17.5rem;
}

.dialog .column.login-body .bankid-login-iframe,
.dialog .column.login-body .bankid-login-iframe iframe {
    min-height: 10rem;
    height: 10rem;
}

.dialog .column.login-body .modal-actions {
    display: flex;
    gap: 0.75rem;
    width: 100%;
}

.dialog .column.login-body .modal-actions button.primary.wide {
    flex: 1;
}

.dialog .column.login-body .modal-message {
    font-size: 0.875rem;
    line-height: 1.5;
    color: #000;
}

.modal-legacy-toggle {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.ui-dialog:has(.dialog) {
    position: fixed !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%);
    margin: 0 !important;
    border: none;
    padding: 0;
    display: flex;
    flex-direction: column;
    width: min(var(--modal-width, 24rem), calc(100vw - 2rem)) !important;
    max-width: calc(100vw - 2rem);
    max-height: calc(100vh - 2rem);
    height: auto !important;
    overflow: hidden;
    box-sizing: border-box;
    border-radius: 0.375rem;
    box-shadow: 0 0.25rem 1.5rem rgba(0, 0, 0, 0.18);
}

.ui-dialog:has(.dialog).modal-animate-in {
    animation: fade-up 0.35s ease-out forwards;
}

.ui-dialog:has(.dialog) .ui-dialog-titlebar {
    display: none;
}

.ui-dialog:has(.dialog) > .ui-dialog-content.dialog {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    min-height: 0 !important;
    max-height: calc(100vh - 2rem);
    box-sizing: border-box;
    padding: 0;
    height: auto !important;
    overflow: hidden;
}

/* Override legacy style.css / mobile.css fixed widths on dialog panels */
.ui-dialog:has(.dialog) > .ui-dialog-content#dialog-basic,
.ui-dialog:has(.dialog) > .ui-dialog-content#dialog-newbankid,
.ui-dialog:has(.dialog) > .ui-dialog-content#dialog-ci,
.ui-dialog:has(.dialog) > .ui-dialog-content#dialog-ci-login,
.ui-dialog:has(.dialog) > .ui-dialog-content#dialog-tc,
.ui-dialog:has(.dialog) > .ui-dialog-content#dialog-ssn,
.ui-dialog:has(.dialog) > .ui-dialog-content#dialog-bankid,
.ui-dialog:has(.dialog) > .ui-dialog-content#dialog-login,
.ui-dialog:has(.dialog) > .ui-dialog-content#dialog-logout,
.ui-dialog:has(.dialog) > .ui-dialog-content#dialog-welcome,
.ui-dialog:has(.dialog) > .ui-dialog-content#dialog-nonregistred,
.ui-dialog:has(.dialog) > .ui-dialog-content#dialog-terms-cond,
.ui-dialog:has(.dialog) > .ui-dialog-content#dialog-arhive {
    width: 100% !important;
    min-width: 0 !important;
    min-height: 0 !important;
    height: auto !important;
}

#dialog-ci-login.dialog {
    background: var(--background-color);
}

#dialog-ci-login.dialog > .column h2 {
    max-width: none;
}

#dialog-ci-login.dialog .field-checkbox {
    align-items: center;
}

#dialog-ci-login.dialog .field-checkbox input[type="checkbox"] {
    width: 1.5rem;
    height: 1.5rem;
    margin: 0;
}

.ui-widget-overlay {
    position: fixed !important;
    inset: 0 !important;
    width: auto !important;
    height: auto !important;
    background: rgba(0, 0, 0, 0.35) !important;
}

.ui-widget-overlay:has(+ .ui-dialog .dialog) {
    animation: fade-in 0.35s ease-out forwards;
}

/* ===============================================
Animations
===============================================
*/

@keyframes fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes fade-up {
    from {
        opacity: 0;
        transform: translate(-50%, calc(-50% + 2rem));
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%);
    }
}

@keyframes float {
    0%, 100% {
        transform: translateY(0);
        opacity: 1;
    }
    50% {
        transform: translateY(0.625rem);
        opacity: 0.75;
    }
}

@keyframes bounce {
    0%, 80%, 100% {
        transform: translateY(0);
        opacity: 0.4;
    }

    40% {
        transform: translateY(-0.25rem);
        opacity: 1;
    }
}


/* 
===============================================
Mobile
===============================================
*/

@media (max-width: 767px) {
    .dialog > .modal-header {
        padding: 1rem 1rem 0;
    }

    .dialog > .column {
        padding: 1.5rem 1.25rem 2.5rem;
    }

    .dialog .column.login-body {
        padding: 1rem 1.25rem 1.5rem;
    }

    .dialog .column.login-flow-body {
        flex-basis: 28rem;
        min-height: 28rem;
        height: 28rem;
    }

    /* Header/burger/drawer mobile rules live once in site-header.css. */

    body:has(#dialog-login) section.hero,
    body:has(#dialog-letter) section.hero {
        display: none;
    }

    body:has(#dialog-login) [data-open-modal="login"] {
        display: none;
    }

    body:has(#dialog-login) #dialog-login.dialog,
    body:has(#dialog-letter) #dialog-letter.dialog {
        display: flex !important;
        flex-direction: column;
        justify-content: flex-start;
        align-items: stretch;
        position: relative;
        isolation: isolate;
        width: 100%;
        max-height: none;
        min-height: 100dvh;
        height: 100dvh;
        box-sizing: border-box;
        padding: var(--header-height) 1.25rem 1.25rem;
        margin: 0;
        box-shadow: none;
        border-radius: 0;
        background-color: transparent;
        overflow: hidden;
        background-image: url('/Images/Start_Hero_Cover.png');
        background-size: cover;
        background-position: right top;
        background-repeat: no-repeat;
    }

    body:has(#dialog-login) #dialog-login.dialog::after,
    body:has(#dialog-letter) #dialog-letter.dialog::after {
        content: '';
        position: absolute;
        inset: 0;
        background: linear-gradient(to bottom, rgba(255, 255, 255, 0.97), rgba(255, 255, 255, 0));
        z-index: 1;
        pointer-events: none;
    }

    body:has(#dialog-login) #dialog-login.dialog > *,
    body:has(#dialog-letter) #dialog-letter.dialog > * {
        position: relative;
        z-index: 2;
    }

    body:has(#dialog-login) #dialog-login.dialog .modal-header,
    body:has(#dialog-letter) #dialog-letter.dialog .modal-header {
        display: none;
    }

    body:has(#dialog-login) #dialog-login.dialog .column.login-body,
    body:has(#dialog-letter) #dialog-letter.dialog .column.login-body {
        flex: 1;
        min-height: 28rem;
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: stretch;
        padding: 2rem 1.5rem;
        box-sizing: border-box;
        width: 100%;
        background: rgba(255, 255, 255, 0.95);
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
        border-radius: 0.375rem;
        box-shadow:
            0 1.25rem 4rem rgba(0, 0, 0, 0.1),
            0 0.5rem 1.5rem rgba(0, 0, 0, 0.06);
    }

    body:has(#dialog-login) #dialog-login.dialog .field,
    body:has(#dialog-login) #dialog-login.dialog .input,
    body:has(#dialog-letter) #dialog-letter.dialog .field,
    body:has(#dialog-letter) #dialog-letter.dialog .input {
        width: 100%;
        max-width: none;
    }

    body:has(#dialog-login) #dialog-login.dialog .column.login-body h2,
    body:has(#dialog-letter) #dialog-letter.dialog .column.login-body h2 {
        font-size: 1.375rem;
        max-width: none;
    }

    section {
        height: auto;
        min-height: auto;
        max-height: none;
        padding: 3rem 1.25rem;
        flex-direction: column;
        gap: 2rem;
    }

    section.hero {
        flex-direction: row;
        height: 100vh;
        min-height: 100vh;
        max-height: none;
        padding: 4rem 1.25rem;
        background-color: transparent;
    }

    section:first-child {
        height: auto;
        min-height: auto;
    }

    section.hero:first-child {
        height: 100vh;
        min-height: 100vh;
    }

    section:nth-of-type(odd):not(.hero) {
        flex-direction: column;
    }

    .row {
        flex-direction: column;
        gap: 2rem;
        height: auto;
    }

    .column {
        height: auto;
        gap: 1.5rem;
    }

    section img {
        width: 100%;
        height: auto;
        align-self: center;
        object-position: top right;
    }

    section.hero > img.hero-cover {
        height: 100%;
        align-self: stretch;
        object-position: right top;
    }

    h1 {
        font-size: 2rem;
    }

    h2 {
        font-size: 1.5rem;
    }

    /* Footer mobile rules live once in site-header.css. */
}
