:root {
    --magenta-500: #321575;
    --purple-600: #750e8b;
    --magenta-600: #a8077a;
    --magenta-700: #870a6a;
    --ink-950: #190f1c;
    --ink-800: #3a2a40;
    --ink-600: #6d5a77;
    --ink-500: #8a7894;
    --ink-300: #cabfd0;
    --ink-200: #e4dce8;
    --ink-100: #f6f2f8;
    --cream: #fdf9fb;
    --white: #ffffff;
}

html {
    background: var(--magenta-500);
}

body {
    background: var(--cream);
    overscroll-behavior-y: auto;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    background: var(--magenta-500);
    z-index: -1;
}

body,
.theme-light,
.theme-dark {
    background: var(--cream);
    color: var(--ink-800);
    font-family: 'Hanken Grotesk', sans-serif;
}

#main-header {
    display: none;
}

.page-content.header-clear-medium {
    min-height: 100vh;
    padding-top: 0 !important;
    display: flex;
    flex-direction: column;
}

#step-phone {
    margin: 0;
    border-radius: 0;
    box-shadow: none;
    background: transparent;
    flex: 1;
}

#step-verify {
    margin: 0;
    border-radius: 0;
    box-shadow: none;
    background: transparent;
    flex: 1;
}

#step-phone .content {
    height: 100%;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
}

#step-verify .content {
    height: 100%;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
}

.login-hero {
    flex-shrink: 0;
    background-color: #321575;
    background-image:
        linear-gradient(180deg, #321575 0px, #321575 calc(env(safe-area-inset-top) + 86px), rgba(230, 0, 141, 0) calc(env(safe-area-inset-top) + 170px)),
        linear-gradient(160deg, #321575 0%, #321575 28%, #8d0b93 100%);
    background-repeat: no-repeat, no-repeat;
    background-size: 100% 100%, 100% 100%;
    background-position: 0 0, 0 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    margin-top: calc(-1 * env(safe-area-inset-top));
    padding: calc(66px + env(safe-area-inset-top)) 20px 34px;
    text-align: center;
}

.logo-pill {
    background: #fff;
    border-radius: 999px;
    padding: 12px 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 6px rgba(39, 16, 41, 0.08), 0 1px 2px rgba(39, 16, 41, 0.06);
}

.logo-pill img {
    height: 32px;
    width: auto;
    object-fit: contain;
    display: block;
}

.login-hero h1 {
    margin: 0;
    font-family: 'Bricolage Grotesque', sans-serif;
    font-weight: 800;
    font-size: 23px;
    letter-spacing: -0.02em;
    color: #fff;
}

.login-hero p {
    margin: 0;
    font-size: 15px;
    font-weight: 500;
    line-height: 1.4;
    color: rgba(255, 255, 255, 0.85);
}

.verify-hero {
    padding-bottom: 24px;
}

.verify-hero h1 {
    font-size: 22px;
}

.verify-hero p {
    font-size: 14px;
}

.login-shell {
    flex: 1;
    min-height: 0;
    background: #fff;
    border-radius: 28px 28px 0 0;
    margin-top: -20px;
    padding: 26px 22px 24px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    overflow-y: auto;
}

.verify-shell {
    justify-content: flex-start;
}

.verify-title {
    margin: 0;
    text-align: center;
    font-family: 'Bricolage Grotesque', sans-serif;
    font-size: 28px;
    font-weight: 800;
    line-height: 1.1;
    color: var(--ink-950);
}

.verify-subtitle {
    margin: 4px 0 0;
    text-align: center;
    font-size: 15px;
    font-weight: 500;
    color: var(--ink-600);
}

.verify-identifier {
    margin: 0;
    text-align: center;
    font-size: 13px;
    font-weight: 500;
    color: var(--ink-600);
}

.verify-identifier span {
    color: var(--ink-950);
    font-weight: 700;
}

.method-toggle {
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-items: center;
    gap: 4px;
    height: 60px;
    background: var(--ink-100);
    border: 1.5px solid var(--ink-200);
    border-radius: 14px;
    padding: 5px;
}

.method-option {
    position: relative;
    height: 100%;
}

.method-option input[type="radio"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.method-option label {
    height: 100%;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: var(--ink-600);
    font-size: 18px;
    font-weight: 700;
    cursor: pointer;
    transition: all 160ms ease-out;
}

.method-option input[type="radio"]:checked+label {
    color: #fff;
    background: linear-gradient(160deg, #321575 0%, #321575 28%, #8d0b93 100%);
}

.method-option label i {
    font-size: 18px;
}

.phone-grid {
    display: flex;
    gap: 10px;
}

.phone-grid .ddi-wrap {
    width: 138px;
    flex-shrink: 0;
}

.field-wrap {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.field-wrap label {
    font-size: 18px;
    font-weight: 600;
    color: var(--ink-950);
    margin: 0;
}

.field-wrap .form-control,
.field-wrap .form-select {
    height: 60px;
    border: 2.5px solid var(--ink-300) !important;
    border-radius: 14px;
    background: #fff;
    box-shadow: none;
    color: var(--ink-800);
    font-size: 21px;
    font-weight: 500;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    padding: 0 14px;
}

.field-wrap .form-select {
    font-size: 18px;
}

#ddi,
#ddi.form-select {
    font-size: 24px !important;
    font-weight: 700;
    line-height: 1.1;
}

.field-wrap .form-control::placeholder {
    color: #9a8da1;
    font-size: 21px;
    font-weight: 500;
}

.input-icon-wrap {
    position: relative;
}

.input-icon-wrap > svg {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    width: 21px;
    height: 21px;
    color: #9a8da1;
    pointer-events: none;
}

.input-icon-wrap .form-control {
    padding-left: 48px !important;
}

.field-wrap .form-control:focus,
.field-wrap .form-select:focus {
    border-color: var(--magenta-500) !important;
    box-shadow: 0 0 0 4px rgba(195, 8, 136, 0.3);
}

.login-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.login-meta .form-check {
    margin: 0;
}

.login-meta .form-check-input {
    width: 22px;
    height: 22px;
    margin-top: 0;
    border: 2px solid var(--ink-300);
}

.login-meta .form-check-input:checked {
    background-color: var(--magenta-500);
    border-color: var(--magenta-500);
}

.login-meta .form-check-label {
    font-size: 18px;
    font-weight: 600;
    color: var(--ink-950);
    padding-left: 8px;
}

.forgot-password {
    display: none;
    font-size: 15px;
    font-weight: 700;
    color: var(--magenta-600);
    text-decoration: none;
}

.login-shell.is-email .forgot-password {
    display: inline;
}

.spacer-flex {
    flex: 1;
    min-height: 8px;
}

#btnSubmitOtp,
.btn-verify {
    min-height: 68px;
    border: 0;
    border-radius: 22px;
    background: linear-gradient(160deg, #321575 0%, #321575 28%, #8d0b93 100%);
    color: #fff;
    font-size: 21px;
    font-weight: 700;
    text-transform: none !important;
    box-shadow: 0 12px 30px rgba(50, 21, 117, 0.22);
    transition: transform 180ms ease, box-shadow 180ms ease, filter 180ms ease;
}

#btnSubmitOtp:not(:disabled):not(.btn-disabled),
.btn-verify:not(:disabled):not(.btn-disabled) {
    background: linear-gradient(160deg, #321575 0%, #321575 28%, #8d0b93 100%) !important;
    color: #fff !important;
    opacity: 1 !important;
}

#btnSubmitOtp:not(:disabled):not(.btn-disabled):hover,
.btn-verify:not(:disabled):not(.btn-disabled):hover {
    transform: translateY(-1px);
    box-shadow: 0 14px 34px rgba(50, 21, 117, 0.28);
    filter: saturate(1.04);
}

#btnSubmitOtp.btn-disabled,
#btnSubmitOtp:disabled,
.btn-verify.btn-disabled,
.btn-verify:disabled {
    background: #d8cfe0 !important;
    color: #8f7998 !important;
    opacity: 1 !important;
    box-shadow: none;
}

.login-social {
    display: none;
}

.signup-copy {
    margin: 0;
    text-align: center;
    font-size: 15px;
    font-weight: 500;
    color: var(--ink-600);
}

.signup-copy a {
    font-weight: 700;
    color: var(--magenta-600);
    text-decoration: none;
}

.login-footer {
    display: flex;
    flex-direction: column;
    gap: 2px;
    align-items: center;
    text-align: center;
}

.login-footer p {
    margin: 0;
    font-size: 12px;
    font-weight: 500;
    color: var(--ink-500);
}

.otp-container {
    display: flex;
    justify-content: center;
    gap: 8px;
}

.otp-input {
    width: 48px;
    height: 60px;
    border-radius: 14px;
    border: 2.5px solid var(--ink-300) !important;
    background: #fff;
    color: var(--ink-950);
    font-size: 30px;
    font-weight: 700;
    outline: 0;
    transition: all 160ms ease-out;
}

.otp-input:focus {
    border-color: var(--magenta-500) !important;
    box-shadow: 0 0 0 4px rgba(195, 8, 136, 0.3);
}

.verify-form-check {
    margin: 4px 0 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.verify-form-check .form-check-input {
    width: 22px;
    height: 22px;
    margin-top: 0;
    border: 2px solid var(--ink-300) !important;
}

.verify-form-check .form-check-input:checked {
    background-color: var(--magenta-500);
    border-color: var(--magenta-500);
}

.verify-form-check .form-check-label {
    font-size: 16px;
    font-weight: 600;
    color: var(--ink-950);
}

.btn-verify {
    min-height: 68px;
    border: 0;
    border-radius: 22px;
    background: linear-gradient(160deg, #321575 0%, #321575 28%, #8d0b93 100%);
    color: #fff;
    font-size: 21px;
    font-weight: 700;
    text-transform: none !important;
    box-shadow: 0 12px 30px rgba(50, 21, 117, 0.22);
    -webkit-tap-highlight-color: transparent;
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
}

.btn-verify:not(:disabled):not(.btn-disabled) {
    background: linear-gradient(160deg, #321575 0%, #321575 28%, #8d0b93 100%) !important;
    color: #fff !important;
    opacity: 1 !important;
}

.btn-verify.btn-disabled,
.btn-verify:disabled {
    background: #d8cfe0 !important;
    color: #8f7998 !important;
    opacity: 1 !important;
    box-shadow: none;
}

.verify-links {
    margin-top: 4px;
    text-align: center;
}

.verify-links p {
    margin: 0;
    font-size: 14px;
    color: var(--ink-600);
}

#resend-otp {
    color: var(--magenta-600);
    font-weight: 700;
    text-decoration: none;
}

#resend-timer {
    margin-top: 4px;
    font-size: 12px;
    color: var(--ink-500);
}

.verify-change {
    margin-top: 4px;
    text-align: center;
}

#change-identifier {
    color: var(--magenta-600);
    font-size: 14px;
    font-weight: 700;
    text-decoration: none;
}

/* Toast estatico (#toast-success/-error/-info) removido - agora e o
   .app-toast unico do projeto (scripts/toast.js + style.css), sem
   markup fixo por pagina. */

@media (min-width: 1024px) and (min-height: 700px) {
    #step-phone .content {
        max-width: 420px;
        margin: 0 auto;
    }

    .login-shell {
        border-radius: 28px;
        margin-top: 0;
        margin-bottom: 24px;
    }

    .verify-shell {
        margin-bottom: 24px;
    }
}

@media (orientation: landscape) and (max-height: 560px) and (max-width: 950px) and (hover: none) and (pointer: coarse) {
    .login-hero {
        padding: calc(env(safe-area-inset-top) + clamp(10px, 3vh, 22px)) 16px clamp(10px, 2.8vh, 16px);
        gap: clamp(6px, 2vh, 8px);
    }

    .logo-pill {
        padding: clamp(8px, 2vh, 10px) clamp(14px, 3vw, 18px);
    }

    .logo-pill img {
        height: clamp(22px, 5vh, 26px);
    }

    .login-hero h1 {
        font-size: clamp(24px, 4.2vw, 30px);
        line-height: 1.05;
    }

    .login-hero p {
        font-size: clamp(13px, 2.2vw, 14px);
    }

    .login-shell {
        margin-top: -10px;
        padding: clamp(14px, 3vh, 18px) 16px clamp(12px, 3vh, 16px);
        border-radius: 20px 20px 0 0;
        gap: clamp(10px, 2.5vh, 14px);
    }

    .verify-title {
        font-size: clamp(22px, 4vw, 26px);
    }

    .verify-subtitle {
        font-size: clamp(13px, 2.4vw, 14px);
    }

    .method-toggle {
        height: clamp(48px, 10vh, 52px);
    }

    .method-option label {
        font-size: clamp(14px, 2.5vw, 16px);
    }

    .field-wrap label {
        font-size: clamp(14px, 2.5vw, 16px);
    }

    .field-wrap .form-control,
    .field-wrap .form-select {
        height: clamp(48px, 10vh, 52px);
        font-size: clamp(16px, 2.8vw, 18px);
    }

    #ddi,
    #ddi.form-select {
        font-size: clamp(18px, 3.2vw, 20px) !important;
    }

    #phone {
        font-size: clamp(18px, 3.2vw, 20px) !important;
    }

    #email {
        font-size: clamp(18px, 3.2vw, 20px) !important;
    }

    .field-wrap .form-control::placeholder {
        font-size: clamp(16px, 2.8vw, 18px);
    }

    #btnSubmitOtp {
        min-height: clamp(52px, 11vh, 58px);
        font-size: clamp(17px, 3vw, 19px);
    }

    .btn-verify {
        min-height: clamp(52px, 11vh, 58px);
        font-size: clamp(17px, 3vw, 19px);
    }

    .otp-input {
        width: clamp(42px, 8vw, 46px);
        height: clamp(48px, 10vh, 52px);
        font-size: clamp(22px, 4vw, 26px);
    }

    .spacer-flex {
        min-height: 0;
        flex: 0;
    }
}

/* DDI - diminuir fonte dos options */
#ddi option {
    font-size: 18px !important;
}

/* Input WhatsApp - aumentar fonte */
#phone {
    font-size: 24px !important;
}

/* Input E-mail - aumentar fonte */
#email {
    font-size: 24px !important;
}

/* Placeholders maiores */
#phone::placeholder,
#email::placeholder {
    font-size: 22px !important;
    opacity: 0.6;
}