/* Telas de autenticação — visual modernizado, mesma identidade (teal #2d9098 + Poppins) */
.auth-modern {
    --brand: var(--bg-system, #2d9098);
    --brand-dark: #237279;
    --brand-soft: rgba(45, 144, 152, .12);
    --ink: #1f2d30;
    --muted: #6b7b7e;
    --line: #dfe6e7;
    --surface: #ffffff;
    --radius: 16px;

    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: #efefef;
}

/* Header teal com curva suave */
.auth-modern .auth-hero {
    position: relative;
    height: auto;
    background: linear-gradient(160deg, var(--brand) 0%, var(--brand-dark) 100%);
    padding: 12px 16px 96px;
    /* border-bottom-left-radius: 32px;
    border-bottom-right-radius: 32px; */
    color: #fff;
    overflow: hidden;
}

.auth-modern .auth-hero::after {
    content: "";
    position: absolute;
    width: 260px;
    height: 260px;
    right: -90px;
    top: -110px;
    border-radius: 50%;
    background: rgba(255, 255, 255, .07);
    pointer-events: none;
}

.auth-modern .auth-topbar {
    max-width: 440px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 8px;
}

.auth-modern .auth-back {
    width: 40px;
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    color: #fff;
    font-size: 26px;
    transition: background-color .2s ease;
}

.auth-modern .auth-back:hover,
.auth-modern .auth-back:focus-visible {
    background: rgba(255, 255, 255, .15);
    color: #fff;
}

.auth-modern .auth-topbar-title {
    flex: 1;
    margin: 0;
    padding-right: 48px; /* compensa botão voltar p/ centralizar */
    text-align: center;
    font-size: 15px;
    font-weight: 400;
    letter-spacing: .3px;
    color: #fff;
}

.auth-modern .auth-brand {
    position: relative;
    z-index: 1;
    max-width: 440px;
    margin: 20px auto 0;
    text-align: center;
}

.auth-modern .auth-logo {
    width: 76px;
    height: 76px;
    margin: 0 auto 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    border-radius: 22px;
    box-shadow: 0 10px 24px rgba(0, 0, 0, .15);
}

.auth-modern .auth-logo img {
    width: 52px;
    height: auto;
}

.auth-modern .auth-brand h1 {
    margin: 0;
    font-size: 22px;
    font-weight: 600;
    color: #fff;
}

.auth-modern .auth-brand p {
    margin: 4px 0 0;
    font-size: 14px;
    color: rgba(255, 255, 255, .85);
}

/* Card do formulário sobreposto ao header */
.auth-modern .auth-body {
    flex: 1;
    padding: 0 16px 40px;
}

.auth-modern .auth-card {
    position: relative;
    z-index: 2;
    max-width: 440px;
    margin: -64px auto 0;
    padding: 28px 22px 24px;
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: 0 18px 40px rgba(31, 45, 48, .10), 0 2px 6px rgba(31, 45, 48, .05);
}

.auth-modern .auth-field + .auth-field {
    margin-top: 18px;
}

.auth-modern .auth-label {
    display: block;
    margin-bottom: 6px;
    font-size: 13px;
    font-weight: 600;
    color: var(--ink);
}

.auth-modern .auth-input-wrap {
    position: relative;
}

.auth-modern .auth-input-wrap > i,
.auth-modern .auth-input-wrap .auth-input-icon {
    position: absolute;
    top: 50%;
    left: 16px;
    transform: translateY(-50%);
    font-size: 20px;
    color: var(--muted);
    pointer-events: none;
    transition: color .2s ease;
}

.auth-modern .auth-input {
    width: 100%;
    height: 54px;
    padding: 0 48px !important;
    font-size: 16px !important;
    color: var(--ink);
    background: #f6f8f8;
    border: 1.5px solid var(--line);
    border-radius: 12px;
    transition: border-color .2s ease, box-shadow .2s ease, background-color .2s ease;
}

.auth-modern .auth-input:hover {
    border-color: #c9d4d5;
}

.auth-modern .auth-input:focus {
    outline: none;
    background: #fff;
    border-color: var(--brand);
    box-shadow: 0 0 0 4px var(--brand-soft);
}

.auth-modern .auth-input-wrap:focus-within .auth-input-icon {
    color: var(--brand);
}

.auth-modern .auth-toggle {
    position: absolute;
    top: 50%;
    right: 6px;
    transform: translateY(-50%);
    width: 42px;
    height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: var(--muted);
    font-size: 20px;
    cursor: pointer;
}

.auth-modern .auth-toggle:hover,
.auth-modern .auth-toggle:focus-visible {
    color: var(--brand);
    background: var(--brand-soft);
    outline: none;
}

.auth-modern .auth-hint {
    display: none;
    margin-top: 6px;
    font-size: 12px;
    color: #b7791f;
}

.auth-modern .auth-hint.is-visible {
    display: flex;
    align-items: center;
    gap: 4px;
}

.auth-modern .auth-hint.is-error {
    color: #c0392b;
}

.auth-modern .auth-hint.is-ok {
    color: #1e8a5a;
}

.auth-modern .auth-req {
    color: #c0392b;
}

.auth-modern .auth-input.is-invalid {
    border-color: #e3a29a;
}

.auth-modern .auth-input.is-invalid:focus {
    border-color: #c0392b;
    box-shadow: 0 0 0 4px rgba(192, 57, 43, .12);
}

/* Checkbox (termos) */
.auth-modern .auth-check {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin: 20px 0 22px;
    font-size: 13px;
    line-height: 1.45;
    color: var(--muted);
    cursor: pointer;
}

.auth-modern .auth-check input {
    flex: 0 0 20px;
    width: 20px;
    height: 20px;
    margin: 0;
    accent-color: var(--brand);
    cursor: pointer;
}

.auth-modern .auth-check a {
    font-weight: 600;
    color: var(--brand);
}

.auth-modern .auth-check a:hover {
    text-decoration: underline;
}

.auth-modern .auth-row {
    display: flex;
    justify-content: flex-end;
    margin: 12px 0 22px;
}

.auth-modern .auth-link {
    font-size: 13px;
    font-weight: 600;
    color: var(--brand);
}

.auth-modern .auth-link:hover {
    color: var(--brand-dark);
    text-decoration: underline;
}

.auth-modern .auth-submit {
    position: relative;
    width: 100%;
    height: 54px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: 0;
    border-radius: 12px;
    background: var(--brand);
    color: #fff;
    font-size: 16px;
    font-weight: 600;
    letter-spacing: .3px;
    box-shadow: 0 8px 18px rgba(45, 144, 152, .30);
    transition: background-color .2s ease, transform .1s ease, box-shadow .2s ease;
}

.auth-modern .auth-submit:hover {
    background: var(--brand-dark);
    box-shadow: 0 10px 22px rgba(45, 144, 152, .38);
}

.auth-modern .auth-submit:active {
    transform: translateY(1px);
}

.auth-modern .auth-submit:focus-visible {
    outline: none;
    box-shadow: 0 0 0 4px var(--brand-soft), 0 8px 18px rgba(45, 144, 152, .30);
}

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

.auth-modern .auth-submit .auth-spinner {
    display: none;
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, .45);
    border-top-color: #fff;
    border-radius: 50%;
    animation: auth-spin .7s linear infinite;
}

.auth-modern .auth-submit.is-loading .auth-spinner {
    display: inline-block;
}

.auth-modern .auth-submit.is-loading .auth-submit-icon {
    display: none;
}

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

.auth-modern .auth-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 24px 0 16px;
    font-size: 12px;
    color: var(--muted);
}

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

.auth-modern .auth-signup {
    width: 100%;
    height: 50px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    border: 1.5px solid var(--brand);
    border-radius: 12px;
    color: var(--brand);
    font-size: 15px;
    font-weight: 600;
    transition: background-color .2s ease, color .2s ease;
}

.auth-modern .auth-signup:hover,
.auth-modern .auth-signup:focus-visible {
    background: var(--brand);
    color: #fff;
}

.auth-modern .auth-footnote {
    max-width: 440px;
    margin: 18px auto 0;
    text-align: center;
    font-size: 12px;
    color: var(--muted);
}

/* Lista de opções (ex.: tipo de cadastro) */
.auth-modern .auth-choices {
    display: grid;
    gap: 12px;
}

.auth-modern .auth-choice {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px;
    background: #f6f8f8;
    border: 1.5px solid var(--line);
    border-radius: 14px;
    color: var(--ink);
    transition: border-color .2s ease, background-color .2s ease, box-shadow .2s ease, transform .1s ease;
}

.auth-modern .auth-choice:hover,
.auth-modern .auth-choice:focus-visible {
    outline: none;
    background: #fff;
    border-color: var(--brand);
    box-shadow: 0 0 0 4px var(--brand-soft);
    color: var(--ink);
}

.auth-modern .auth-choice:active {
    transform: translateY(1px);
}

.auth-modern .auth-choice-icon {
    flex: 0 0 48px;
    width: 48px;
    height: 48px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    background: var(--brand-soft);
    color: var(--brand);
    font-size: 24px;
    transition: background-color .2s ease, color .2s ease;
}

.auth-modern .auth-choice:hover .auth-choice-icon,
.auth-modern .auth-choice:focus-visible .auth-choice-icon {
    background: var(--brand);
    color: #fff;
}

.auth-modern .auth-choice-text {
    flex: 1;
    min-width: 0;
}

.auth-modern .auth-choice-title {
    display: block;
    font-size: 15px;
    font-weight: 600;
}

.auth-modern .auth-choice-desc {
    display: block;
    margin-top: 2px;
    font-size: 12.5px;
    line-height: 1.4;
    color: var(--muted);
}

.auth-modern .auth-choice-arrow {
    font-size: 22px;
    color: var(--muted);
    transition: color .2s ease, transform .2s ease;
}

.auth-modern .auth-choice:hover .auth-choice-arrow,
.auth-modern .auth-choice:focus-visible .auth-choice-arrow {
    color: var(--brand);
    transform: translateX(3px);
}

.auth-modern .auth-alt {
    margin: 20px 0 0;
    text-align: center;
    font-size: 13px;
    color: var(--muted);
}

/* Cards largos (formulários de cadastro com mais campos) */
.auth-modern .auth-card.is-wide,
.auth-modern .auth-hero.is-wide .auth-topbar,
.auth-modern .auth-hero.is-wide .auth-brand {
    max-width: 600px;
}

.auth-modern .auth-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 14px;
}

.auth-modern .auth-grid.is-city {
    grid-template-columns: 2fr 1fr;
}

.auth-modern .auth-grid > .auth-field + .auth-field {
    margin-top: 0;
}

.auth-modern .auth-grid > .auth-field {
    margin-bottom: 18px;
}

.auth-modern .auth-field + .auth-grid {
    margin-top: 18px;
}

.auth-modern .auth-grid:last-child > .auth-field {
    margin-bottom: 0;
}

@media (max-width: 575px) {
    .auth-modern .auth-grid,
    .auth-modern .auth-grid.is-city {
        grid-template-columns: 1fr;
    }
}

.auth-modern .auth-help {
    display: block;
    margin-top: 6px;
    font-size: 12px;
    color: var(--muted);
}

.auth-modern .auth-input:disabled {
    background: #eef1f1;
    color: #9aa7a9;
    cursor: not-allowed;
}

.auth-modern .auth-input[readonly] {
    background: #eef1f1;
}

.auth-modern .auth-input.is-plain {
    padding: 0 16px !important;
}

.auth-modern .auth-input-wrap .auth-input-loader {
    position: absolute;
    top: 50%;
    right: 16px;
    width: 18px;
    height: 18px;
    margin-top: -9px;
    border: 2px solid var(--brand-soft);
    border-top-color: var(--brand);
    border-radius: 50%;
    animation: auth-spin .7s linear infinite;
    display: none;
}

.auth-modern .auth-input-wrap.is-loading .auth-input-loader {
    display: block;
}

.auth-modern .auth-section {
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1.5px solid #eef1f1;
}

.auth-modern .auth-section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 14px;
}

.auth-modern .auth-section-title {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    font-size: 14px;
    font-weight: 600;
    color: var(--ink);
}

.auth-modern .auth-section-title i {
    font-size: 18px;
    color: var(--brand);
}

/* Stepper */
.auth-modern .auth-steps {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
    padding: 0;
    list-style: none;
}

.auth-modern .auth-step {
    flex: 1;
    min-width: 0;
}

.auth-modern .auth-step-bar {
    display: block;
    height: 5px;
    border-radius: 99px;
    background: var(--line);
    overflow: hidden;
    position: relative;
}

.auth-modern .auth-step-bar::after {
    content: "";
    position: absolute;
    inset: 0;
    width: 0;
    background: var(--brand);
    border-radius: inherit;
    transition: width .35s ease;
}

.auth-modern .auth-step.is-active .auth-step-bar::after,
.auth-modern .auth-step.is-done .auth-step-bar::after {
    width: 100%;
}

.auth-modern .auth-step-label {
    display: block;
    margin-top: 8px;
    font-size: 12px;
    font-weight: 500;
    color: var(--muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.auth-modern .auth-step.is-active .auth-step-label {
    font-weight: 600;
    color: var(--brand);
}

.auth-modern .auth-step.is-done .auth-step-label {
    color: var(--ink);
}

.auth-modern .auth-step-pane {
    animation: auth-fade .3s ease;
}

.auth-modern .auth-step-pane[hidden] {
    display: none;
}

.auth-modern .auth-step-heading {
    margin: 0 0 4px;
    font-size: 17px;
    font-weight: 600;
    color: var(--ink);
}

.auth-modern .auth-step-sub {
    margin: 0 0 20px;
    font-size: 13px;
    color: var(--muted);
}

@keyframes auth-fade {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: none; }
}

.auth-modern .auth-actions {
    display: flex;
    gap: 12px;
    margin-top: 24px;
}

.auth-modern .auth-actions .auth-submit {
    flex: 1;
}

.auth-modern .auth-submit.is-finish {
    background: #f79a1e;
    box-shadow: 0 8px 18px rgba(247, 154, 30, .30);
}

.auth-modern .auth-submit.is-finish:hover {
    background: #e0870f;
}

.auth-modern .auth-btn-ghost {
    height: 54px;
    padding: 0 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    border: 1.5px solid var(--line);
    border-radius: 12px;
    background: #fff;
    color: var(--ink);
    font-size: 15px;
    font-weight: 600;
    transition: border-color .2s ease, color .2s ease, background-color .2s ease;
}

.auth-modern .auth-btn-ghost:hover,
.auth-modern .auth-btn-ghost:focus-visible {
    outline: none;
    border-color: var(--brand);
    color: var(--brand);
}

.auth-modern .auth-btn-ghost[hidden] {
    display: none;
}

.auth-modern .auth-btn-ghost.is-small {
    height: 38px;
    padding: 0 14px;
    font-size: 13px;
    border-radius: 10px;
}

.auth-modern .auth-btn-ghost:disabled {
    opacity: .5;
    cursor: not-allowed;
    border-color: var(--line);
    color: var(--muted);
}

/* Opções em card (radio) */
.auth-modern .auth-options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin: 0;
    padding: 0;
    border: 0;
}

.auth-modern .auth-option {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
    height: 54px;
    padding: 0 16px;
    background: #f6f8f8;
    border: 1.5px solid var(--line);
    border-radius: 12px;
    font-size: 15px;
    color: var(--ink);
    cursor: pointer;
    transition: border-color .2s ease, background-color .2s ease, box-shadow .2s ease;
}

.auth-modern .auth-option input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.auth-modern .auth-option i {
    font-size: 20px;
    color: var(--muted);
}

.auth-modern .auth-option:hover {
    border-color: #c9d4d5;
}

.auth-modern .auth-option:has(input:checked) {
    background: #fff;
    border-color: var(--brand);
    box-shadow: 0 0 0 4px var(--brand-soft);
}

.auth-modern .auth-option:has(input:checked) i {
    color: var(--brand);
}

.auth-modern .auth-option:has(input:focus-visible) {
    box-shadow: 0 0 0 4px var(--brand-soft);
}

/* Mapa */
.auth-modern .auth-map {
    height: 280px;
    width: 100%;
    border-radius: 12px;
    border: 1.5px solid var(--line);
    z-index: 0;
}

/* Tela de sucesso */
.auth-modern .auth-success {
    padding: 12px 0 4px;
    text-align: center;
    animation: auth-fade .4s ease;
}

.auth-modern .auth-success[hidden] {
    display: none;
}

.auth-modern .auth-success-icon {
    width: 76px;
    height: 76px;
    margin: 0 auto 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--brand-soft);
    color: var(--brand);
    font-size: 40px;
}

.auth-modern .auth-success h3 {
    margin: 0 0 8px;
    font-size: 21px;
    font-weight: 600;
    color: var(--ink);
}

.auth-modern .auth-success p {
    margin: 0 0 22px;
    font-size: 14px;
    line-height: 1.6;
    color: var(--muted);
}

@media (min-width: 768px) {
    .auth-modern .auth-hero {
        padding-bottom: 110px;
    }

    .auth-modern .auth-card {
        padding: 34px 32px 28px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .auth-modern * {
        transition: none !important;
        animation-duration: .01ms !important;
    }
}
