:root {
    --navy-950: #041f35;
    --navy-900: #062b49;
    --navy-800: #0a3a60;
    --cyan-500: #24b8df;
    --cyan-600: #0e9fc8;
    --cyan-100: #def6fc;
    --ink-950: #132238;
    --ink-700: #42526a;
    --ink-500: #6d7a8d;
    --line-300: #cfd7e2;
    --line-200: #e4e9ef;
    --surface: #ffffff;
    --surface-muted: #f6f8fb;
    --danger-700: #a52128;
    --danger-100: #fff0f1;
    --success-700: #176b4b;
    --success-100: #e9f7f1;
    --focus: #167fc1;
    --shadow: 0 18px 50px rgba(4, 31, 53, 0.12);
}

* {
    box-sizing: border-box;
}

html {
    min-width: 320px;
    background: var(--surface);
    color: var(--ink-950);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
    font-size: 16px;
}

body.login-v2 {
    min-width: 320px;
    min-height: 100vh;
    margin: 0;
    background: var(--surface);
    color: var(--ink-950);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

button,
input,
select {
    font: inherit;
}

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

button {
    cursor: pointer;
}

button:disabled {
    cursor: not-allowed;
}

a {
    color: inherit;
}

[hidden] {
    display: none !important;
}

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

.brand-panel {
    position: relative;
    display: none;
    min-height: 100vh;
    overflow: hidden;
    background-color: var(--navy-950);
    background-image: var(--brand-art);
    background-position: 15% center;
    background-size: cover;
    color: #fff;
}

.brand-panel::before {
    position: absolute;
    inset: 0;
    content: "";
    background: linear-gradient(150deg, rgba(4, 31, 53, 0.9), rgba(4, 31, 53, 0.7));
}

.brand-panel__content {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    min-height: 100%;
    padding: clamp(36px, 5vw, 76px);
}

.brand-logo {
    display: inline-block;
    align-self: flex-start;
}

.brand-logo img,
.mobile-brand img {
    display: block;
    width: 174px;
    height: auto;
    filter: brightness(0) invert(1);
}

.brand-logo--client {
    border-radius: 11px;
    background: rgba(255, 255, 255, 0.96);
    padding: 10px 14px;
}

.brand-logo--client img.is-client-logo {
    width: auto;
    max-width: 210px;
    max-height: 70px;
    object-fit: contain;
    filter: none;
}

.event-brand-bar {
    display: none;
}

.mobile-event-brand-bar {
    display: none;
}

.brand-copy {
    max-width: 520px;
    margin: auto 0;
    padding: 70px 0;
}

.brand-eyebrow,
.section-label,
.step-count {
    margin: 0 0 8px;
    color: var(--cyan-500);
    font-size: 0.76rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.brand-copy h1 {
    max-width: 620px;
    margin: 0;
    color: #fff;
    font-size: clamp(3.1rem, 5.5vw, 5.7rem);
    font-weight: 800;
    letter-spacing: -0.06em;
    line-height: 0.98;
}

.brand-copy h1 span {
    color: var(--cyan-500);
}

.brand-copy > p:last-child {
    max-width: 480px;
    margin: 26px 0 0;
    color: rgba(255, 255, 255, 0.78);
    font-size: 1.05rem;
}

.brand-support {
    display: flex;
    gap: 8px;
    color: rgba(255, 255, 255, 0.68);
    font-size: 0.86rem;
}

.brand-support a {
    color: #fff;
    font-weight: 700;
    text-underline-offset: 3px;
}

.flow-panel {
    min-width: 0;
    min-height: 100vh;
    background: var(--surface);
}

.flow-container {
    width: min(100%, 760px);
    margin: 0 auto;
    padding: 0 22px 36px;
}

.flow-view {
    width: 100%;
}

.flow-view--login {
    max-width: 510px;
    margin: 0 auto;
}

.mobile-brand {
    position: relative;
    min-height: 206px;
    margin: 0 -22px 34px;
    overflow: hidden;
    background-color: var(--navy-950);
    background-image: var(--brand-art);
    background-position: 15% 44%;
    background-size: cover;
    color: #fff;
}

.mobile-brand::before {
    position: absolute;
    inset: 0;
    content: "";
    background: linear-gradient(150deg, rgba(4, 31, 53, 0.92), rgba(4, 31, 53, 0.75));
}

.mobile-brand img,
.mobile-brand p {
    position: relative;
    z-index: 1;
}

.mobile-brand img {
    width: 132px;
    margin: 0;
    padding-top: calc(23px + env(safe-area-inset-top));
    margin-left: 23px;
}

.mobile-brand img.is-client-logo {
    width: auto;
    max-width: 190px;
    max-height: 72px;
    margin-top: calc(23px + env(safe-area-inset-top));
    margin-left: 23px;
    border-radius: 9px;
    background: rgba(255, 255, 255, 0.96);
    object-fit: contain;
    padding: 8px 11px;
    filter: none;
}

.mobile-brand p {
    margin: 39px 23px 0;
    font-size: 2rem;
    font-weight: 800;
    letter-spacing: -0.045em;
    line-height: 1.02;
}

.mobile-brand p strong {
    display: block;
    color: var(--cyan-500);
}

.flow-heading {
    margin-bottom: 28px;
}

.flow-heading h2 {
    margin: 0;
    color: var(--ink-950);
    font-size: clamp(1.75rem, 6vw, 2.2rem);
    font-weight: 800;
    letter-spacing: -0.045em;
    line-height: 1.12;
}

.flow-heading > p:last-child {
    max-width: 590px;
    margin: 10px 0 0;
    color: var(--ink-500);
    font-size: 0.96rem;
}

.flow-heading--step {
    margin-top: 30px;
}

.form-stack,
.form-step {
    display: grid;
    gap: 20px;
}

.field {
    position: relative;
    min-width: 0;
}

.field label,
.choice-group legend {
    display: block;
    margin: 0 0 7px;
    color: var(--ink-950);
    font-size: 0.88rem;
    font-weight: 700;
}

.field label span {
    color: var(--ink-500);
    font-weight: 400;
}

.field input,
.field select,
.password-field input,
.field-with-action input {
    width: 100%;
    min-height: 50px;
    border: 1px solid var(--line-300);
    border-radius: 9px;
    outline: 0;
    background: var(--surface);
    color: var(--ink-950);
    padding: 12px 14px;
    transition: border-color 150ms ease, box-shadow 150ms ease, background-color 150ms ease;
}

.field input::placeholder,
.password-field input::placeholder {
    color: #8c98a9;
}

.field input:hover,
.field select:hover,
.password-field input:hover,
.field-with-action input:hover {
    border-color: #9eabbc;
}

.field input:focus,
.field select:focus,
.password-field input:focus,
.field-with-action input:focus {
    border-color: var(--focus);
    box-shadow: 0 0 0 3px rgba(22, 127, 193, 0.16);
}

.field input[aria-invalid="true"],
.field select[aria-invalid="true"] {
    border-color: var(--danger-700);
    background: #fffafa;
}

.field input.is-validated,
.field select.is-validated {
    border-color: var(--cyan-500);
    box-shadow: 0 0 0 2px rgba(36, 184, 223, 0.1);
}

.field input.is-validated:not([type="password"]),
.password-field input.is-validated,
.field select.is-validated {
    padding-right: 42px;
    background-color: #f7fdff;
}

.field:has(> input.is-validated)::after,
.field:has(> select.is-validated)::after,
.field-with-action:has(> input.is-validated)::after,
.password-field:has(> input.is-validated)::after {
    position: absolute;
    z-index: 2;
    display: grid;
    width: 22px;
    height: 22px;
    place-items: center;
    border-radius: 50%;
    background: var(--cyan-500);
    color: var(--navy-950);
    content: "✓";
    font-size: 0.82rem;
    font-weight: 900;
    line-height: 1;
    pointer-events: none;
}

.field:has(> input.is-validated)::after,
.field:has(> select.is-validated)::after {
    top: 42px;
    right: 12px;
}

.field:has(> select.is-validated)::after {
    right: 34px;
}

.field-with-action:has(> input.is-validated)::after,
.password-field:has(> input.is-validated)::after {
    top: 50%;
    right: 82px;
    transform: translateY(-50%);
}

.field-with-action input.is-validated:not([type="password"]) {
    padding-right: 112px;
    background-position: right 82px center;
}

.password-field input.is-validated {
    padding-right: 112px;
    background-position: right 82px center;
}

.field-label-row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 16px;
}

.text-link,
.legacy-link a,
.text-button {
    color: var(--navy-800);
    font-weight: 700;
    text-underline-offset: 3px;
}

.field-label-row .text-link {
    font-size: 0.82rem;
}

.field-message,
.field-hint {
    display: block;
    min-height: 1.2em;
    margin-top: 6px;
    color: var(--ink-500);
    font-size: 0.78rem;
}

.field-message:not(:empty) {
    color: var(--danger-700);
}

.field-hint.is-checking {
    color: var(--navy-800);
    font-weight: 700;
}

.field-hint.is-success {
    color: var(--success-700);
    font-weight: 700;
}

.field-hint.is-error {
    color: var(--danger-700);
    font-weight: 700;
}

.account-callout {
    display: grid;
    gap: 14px;
    border: 1px solid #9eddef;
    border-radius: 11px;
    background: var(--cyan-100);
    color: var(--navy-950);
    padding: 16px;
}

.account-callout strong {
    display: block;
    font-size: 0.92rem;
}

.account-callout p {
    margin: 3px 0 0;
    color: var(--ink-700);
    font-size: 0.82rem;
}

.account-callout__action {
    justify-self: start;
    min-height: 42px;
    border: 1px solid var(--navy-800);
    border-radius: 8px;
    background: var(--navy-800);
    color: #fff;
    padding: 9px 14px;
    font-size: 0.8rem;
    font-weight: 800;
}

.account-callout__action:hover {
    background: var(--navy-950);
}

.password-field,
.field-with-action {
    position: relative;
}

.password-field input {
    padding-right: 78px;
}

.password-toggle,
.field-action {
    position: absolute;
    top: 50%;
    right: 8px;
    min-height: 36px;
    border: 0;
    border-radius: 7px;
    background: transparent;
    color: var(--navy-800);
    padding: 6px 9px;
    font-size: 0.76rem;
    font-weight: 800;
    transform: translateY(-50%);
}

.field-action {
    border-left: 1px solid var(--line-200);
    border-radius: 0;
    padding-left: 14px;
}

.field-with-action input {
    padding-right: 82px;
}

.primary-button,
.secondary-button,
.back-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    min-height: 52px;
    border-radius: 9px;
    padding: 12px 20px;
    font-weight: 800;
    transition: background-color 150ms ease, border-color 150ms ease, color 150ms ease, transform 150ms ease;
}

.primary-button {
    border: 1px solid var(--cyan-500);
    background: var(--cyan-500);
    color: var(--navy-950);
}

.primary-button:hover {
    border-color: var(--cyan-600);
    background: var(--cyan-600);
}

.primary-button:active,
.secondary-button:active,
.back-button:active {
    transform: translateY(1px);
}

.primary-button:disabled {
    border-color: #d9e0e8;
    background: #e8edf2;
    color: #7b8797;
}

.secondary-button {
    width: 100%;
    border: 1px solid var(--navy-800);
    background: var(--surface);
    color: var(--navy-800);
}

.secondary-button:hover {
    background: var(--surface-muted);
}

.back-button {
    border: 1px solid transparent;
    background: transparent;
    color: var(--navy-800);
}

.flow-divider {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 12px;
    margin: 26px 0;
    color: var(--ink-500);
    font-size: 0.8rem;
}

.flow-divider::before,
.flow-divider::after {
    height: 1px;
    content: "";
    background: var(--line-200);
}

.secondary-action {
    text-align: center;
}

.secondary-action p {
    margin: 0 0 12px;
    color: var(--ink-500);
    font-size: 0.9rem;
}

.legacy-link,
.registration-security {
    margin: 24px 0 0;
    color: var(--ink-500);
    font-size: 0.78rem;
    text-align: center;
}

.registration-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: calc(20px + env(safe-area-inset-top)) 0 18px;
    border-bottom: 1px solid var(--line-200);
}

.registration-header > div {
    text-align: right;
}

.registration-header p {
    margin: 0;
}

.registration-header .step-count {
    color: var(--ink-500);
    font-size: 0.72rem;
}

.back-to-login {
    border: 0;
    background: transparent;
    color: var(--navy-800);
    padding: 8px 0;
    font-weight: 800;
}

.stepper {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin: 24px 0 12px;
}

.stepper__item {
    display: flex;
    flex: 0 1 92px;
    flex-direction: column;
    align-items: center;
    min-width: 46px;
    border: 0;
    background: transparent;
    color: var(--ink-500);
    padding: 0;
    font-size: 0.67rem;
    text-align: center;
}

.stepper__item:disabled {
    opacity: 1;
}

.stepper__number {
    display: inline-grid;
    width: 34px;
    height: 34px;
    place-items: center;
    border: 1px solid var(--line-300);
    border-radius: 50%;
    background: var(--surface);
    color: var(--ink-500);
    font-size: 0.78rem;
    font-weight: 800;
}

.stepper__label {
    margin-top: 6px;
    line-height: 1.2;
}

.stepper__item.is-active,
.stepper__item.is-complete {
    color: var(--navy-950);
    font-weight: 800;
}

.stepper__item.is-active .stepper__number {
    border-color: var(--navy-900);
    background: var(--navy-900);
    color: #fff;
}

.stepper__item.is-complete .stepper__number {
    border-color: var(--cyan-500);
    background: var(--cyan-500);
    color: var(--navy-950);
}

.stepper__item.is-complete .stepper__number {
    font-size: 0;
}

.stepper__item.is-complete .stepper__number::after {
    content: "✓";
    font-size: 0.9rem;
}

.stepper__line {
    flex: 1 1 34px;
    height: 1px;
    margin: 17px 5px 0;
    background: var(--line-300);
}

.switch-row {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: 16px;
    cursor: pointer;
}

.switch-row > span:first-child {
    display: grid;
}

.switch-row strong {
    color: var(--ink-950);
    font-size: 0.9rem;
}

.switch-row small {
    margin-top: 2px;
    color: var(--ink-500);
    font-size: 0.78rem;
}

.switch-row input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
}

.switch-control {
    position: relative;
    width: 43px;
    height: 25px;
    border-radius: 15px;
    background: #cbd4df;
    transition: background-color 150ms ease;
}

.switch-control::after {
    position: absolute;
    top: 3px;
    left: 3px;
    width: 19px;
    height: 19px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 1px 4px rgba(4, 31, 53, 0.25);
    content: "";
    transition: transform 150ms ease;
}

.switch-row input:checked + .switch-control {
    background: var(--cyan-500);
}

.switch-row input:checked + .switch-control::after {
    transform: translateX(18px);
}

.switch-row input:focus-visible + .switch-control {
    outline: 3px solid rgba(22, 127, 193, 0.28);
    outline-offset: 2px;
}

.choice-group {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    min-width: 0;
    margin: 0;
    border: 0;
    padding: 0;
}

.choice-group legend {
    grid-column: 1 / -1;
}

.choice-card {
    display: flex;
    align-items: center;
    min-height: 48px;
    gap: 10px;
    border: 1px solid var(--line-300);
    border-radius: 9px;
    padding: 11px 13px;
    cursor: pointer;
}

.choice-card:has(input:checked) {
    border-color: var(--cyan-600);
    background: var(--cyan-100);
}

.choice-card input {
    width: 17px;
    height: 17px;
    accent-color: var(--navy-900);
}

.choice-card span {
    font-size: 0.88rem;
    font-weight: 650;
}

.field-grid {
    display: grid;
    gap: 18px;
}

.form-actions {
    display: grid;
    grid-template-columns: auto minmax(170px, 1fr);
    gap: 12px;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid var(--line-200);
}

.form-actions .primary-button {
    grid-column: 2;
}

.feedback {
    margin: 0 0 20px;
    border: 1px solid #efb8bb;
    border-radius: 9px;
    background: var(--danger-100);
    color: var(--danger-700);
    padding: 12px 14px;
    font-size: 0.86rem;
}

.feedback.is-success {
    border-color: #a9dcc9;
    background: var(--success-100);
    color: var(--success-700);
}

.review-card {
    border: 1px solid var(--line-200);
    border-radius: 12px;
    background: var(--surface-muted);
    padding: 18px;
}

.review-card__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--line-200);
}

.review-card__header h3 {
    margin: 0;
    font-size: 1rem;
}

.text-button {
    border: 0;
    background: transparent;
    padding: 4px 0;
    font-size: 0.8rem;
    text-decoration: underline;
}

.review-list {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
    margin: 16px 0 0;
}

.review-list > div {
    min-width: 0;
}

.review-list dt {
    color: var(--ink-500);
    font-size: 0.7rem;
    font-weight: 750;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.review-list dd {
    overflow: hidden;
    margin: 2px 0 0;
    color: var(--ink-950);
    font-size: 0.86rem;
    text-overflow: ellipsis;
}

.confirmation-check {
    display: grid;
    grid-template-columns: auto 1fr;
    align-items: start;
    gap: 10px;
    color: var(--ink-700);
    font-size: 0.82rem;
    cursor: pointer;
}

.confirmation-check input {
    width: 18px;
    height: 18px;
    margin: 2px 0 0;
    accent-color: var(--navy-900);
}

.loading-overlay {
    position: fixed;
    z-index: 100;
    inset: 0;
    display: grid;
    place-items: center;
    background: rgba(4, 31, 53, 0.72);
    padding: 24px;
}

.loading-dialog {
    width: min(100%, 410px);
    border-radius: 14px;
    background: #fff;
    box-shadow: var(--shadow);
    padding: 32px;
    text-align: center;
}

.loading-dialog strong {
    display: block;
    margin-top: 16px;
    font-size: 1.04rem;
}

.loading-dialog p {
    margin: 7px 0 0;
    color: var(--ink-500);
    font-size: 0.85rem;
}

.loading-spinner {
    display: inline-block;
    width: 36px;
    height: 36px;
    border: 3px solid var(--line-200);
    border-top-color: var(--cyan-500);
    border-radius: 50%;
    animation: spin 700ms linear infinite;
}

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

@media (min-width: 640px) {
    .flow-container {
        padding: 44px 42px 52px;
    }

    .mobile-brand {
        margin: -44px -42px 42px;
    }

    .registration-header {
        padding-top: 0;
    }

    .field-grid--2,
    .field-grid--2-1 {
        grid-template-columns: 1fr 1fr;
    }

    .field-grid--2-1 {
        grid-template-columns: 1.3fr 1fr 90px;
    }

    .field-grid--address {
        grid-template-columns: 2fr 0.7fr 1.2fr;
    }

    .field--street {
        grid-column: span 2;
    }

    .field--complement {
        grid-column: 1;
    }

    .field--district {
        grid-column: span 2;
    }

    .field--city {
        grid-column: span 2;
    }

    .review-list {
        grid-template-columns: 1fr 1fr;
    }
}

@media (min-width: 1024px) {
    .app-shell {
        display: grid;
        grid-template-columns: minmax(360px, 39vw) minmax(0, 1fr);
    }

    .brand-panel {
        position: sticky;
        top: 0;
        display: block;
        height: 100vh;
    }

    .flow-panel {
        display: grid;
        align-items: center;
        overflow: visible;
    }

    .flow-container {
        max-width: 820px;
        padding: 54px clamp(44px, 6vw, 86px) 58px;
    }

    .mobile-brand {
        display: none;
    }

    .flow-view--register {
        max-height: none;
        overflow: visible;
        padding-right: 0;
    }

    .flow-view--login {
        padding: 24px 0;
    }

    body.login-v2.has-event-background {
        background-color: var(--navy-950);
        background-image: var(--brand-art);
        background-position: right top;
        background-size: cover;
        background-attachment: fixed;
    }

    .has-event-background .app-shell {
        display: flex;
        min-height: 100vh;
        align-items: flex-start;
        padding: clamp(24px, 4vw, 64px);
    }

    .has-event-background .brand-panel {
        display: none;
    }

    .has-event-background .flow-panel {
        display: block;
        width: min(475px, calc(100vw - 48px));
        min-height: 0;
        margin-left: clamp(0px, 4vw, 60px);
        overflow: visible;
        border: 1px solid rgba(228, 233, 239, 0.9);
        border-radius: 18px;
        background: rgba(255, 255, 255, 0.98);
        box-shadow: 0 24px 70px rgba(4, 31, 53, 0.24);
    }

    .has-event-background .flow-container {
        width: 100%;
        max-width: none;
        padding: 32px 32px 40px;
    }

    .has-event-background .event-brand-bar {
        display: flex;
        min-height: 64px;
        align-items: center;
        gap: 20px;
        margin-bottom: 32px;
        border-bottom: 1px solid var(--line-200);
        padding-bottom: 22px;
    }

    .event-brand-bar__econrio {
        width: 145px;
        height: auto;
    }

    .event-brand-bar__divider {
        width: 1px;
        align-self: stretch;
        background: var(--line-200);
    }

    .event-brand-bar__client {
        width: auto;
        max-width: 190px;
        max-height: 68px;
        object-fit: contain;
    }

    .has-event-background .flow-view--login {
        max-width: none;
        padding: 0;
    }
}

@media (max-width: 1023px) {
    .has-event-background .mobile-brand {
        min-height: 156px;
        margin-bottom: 0;
        background-position: center center;
    }

    .has-event-background .mobile-brand::before {
        background: linear-gradient(150deg, rgba(4, 31, 53, 0.74), rgba(4, 31, 53, 0.45));
    }

    .has-event-background .mobile-brand img {
        display: none;
    }

    .has-event-background .mobile-event-brand-bar {
        display: flex;
        min-height: 64px;
        align-items: center;
        gap: 12px;
        margin-bottom: 28px;
        padding: calc(18px + env(safe-area-inset-top)) 0 18px;
        border-bottom: 1px solid var(--line-200);
    }

    .has-event-background .event-brand-bar__econrio {
        width: min(120px, 42%);
        height: auto;
    }

    .has-event-background .event-brand-bar__divider {
        width: 1px;
        align-self: stretch;
        background: var(--line-200);
    }

    .has-event-background .event-brand-bar__client {
        width: auto;
        max-width: 42%;
        max-height: 54px;
        object-fit: contain;
    }

}

@media (min-width: 640px) and (max-width: 1023px) {
    .has-event-background .mobile-event-brand-bar {
        padding-top: 0;
    }
}

@media (max-width: 430px) {
    .stepper__label {
        max-width: 70px;
        font-size: 0.61rem;
    }

    .stepper__line {
        margin-right: 2px;
        margin-left: 2px;
    }

    .field-grid--2-1 {
        grid-template-columns: 1fr 105px;
    }

    .field-grid--2-1 .field:first-child {
        grid-column: 1 / -1;
    }
}

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