/* Base: SignUp_LogIn_Form (leonam-silva-de-souza) — extended for Let's go auth */
@import url('https://fonts.googleapis.com/css2?family=Poppins:ital,wght@0,300;0,400;0,500;0,600;0,700&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: "Poppins", sans-serif;
    list-style: none;
}

body {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: linear-gradient(90deg, #e2e2e2, #c9d6ff);
    padding: 16px;
}

.auth-page {
    width: 100%;
    max-width: 900px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
}

.auth-header {
    width: 100%;
    max-width: 850px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
    overflow: visible;
}

.auth-header-end {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-left: auto;
    flex-shrink: 0;
    overflow: visible;
}

.auth-map-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    font-weight: 600;
    color: #4a63c9;
    text-decoration: none;
}

.auth-map-link:hover {
    text-decoration: underline;
}

.session-bar {
    display: none;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    font-size: 13px;
    color: #333;
    background: rgba(255, 255, 255, 0.85);
    padding: 8px 14px;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
}

.session-bar.visible {
    display: flex;
}

.session-bar button {
    padding: 6px 12px;
    border-radius: 8px;
    border: 2px solid #7494ec;
    background: #fff;
    color: #7494ec;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    font-family: inherit;
}

.container {
    position: relative;
    width: 850px;
    max-width: 100%;
    min-height: 720px;
    height: auto;
    background: #fff;
    border-radius: 30px;
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.2);
    overflow: hidden;
}

.container h1 {
    font-size: 32px;
    margin: -6px 0 8px;
}

.container .form-box > form > p.signup-hint {
    font-size: 12px;
    color: #666;
    margin: 12px 0 0;
    line-height: 1.4;
    text-align: center;
}

form {
    width: 100%;
}

.form-box {
    position: absolute;
    right: 0;
    width: 50%;
    height: 100%;
    min-height: 720px;
    background: #fff;
    display: flex;
    align-items: center;
    color: #333;
    text-align: center;
    padding: 36px 40px;
    z-index: 1;
    transition: 0.6s ease-in-out 1.2s, visibility 0s 1s;
}

.container.active .form-box {
    right: 50%;
}

.form-box.login {
    flex-direction: column;
    justify-content: center;
    align-items: stretch;
}

.form-box.register {
    visibility: hidden;
}

.container.active .form-box.register {
    visibility: visible;
}

.form-box form {
    max-height: 100%;
    overflow-y: scroll;
    scrollbar-gutter: stable;
    scrollbar-width: thin;
    scrollbar-color: #9ca3af #e5e7eb;
    padding-right: 4px;
}

.form-box form::-webkit-scrollbar {
    width: 8px;
}

.form-box form::-webkit-scrollbar-track {
    background: #e5e7eb;
    border-radius: 4px;
}

.form-box form::-webkit-scrollbar-thumb {
    background: #9ca3af;
    border-radius: 4px;
}

.form-box form::-webkit-scrollbar-thumb:hover {
    background: #6b7280;
}

.form-box.register .input-box {
    margin: 14px 0;
}

.input-box {
    position: relative;
    margin: 22px 0;
}

.input-box input {
    width: 100%;
    padding: 13px 50px 13px 20px;
    background: #eee;
    border-radius: 8px;
    border: none;
    outline: none;
    font-size: 15px;
    color: #333;
    font-weight: 500;
}

.input-box input::placeholder {
    color: #888;
    font-weight: 400;
}

.input-box > i {
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 20px;
    color: #555;
    pointer-events: none;
}

.input-box .password-toggle {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    padding: 0;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: #555;
    cursor: pointer;
    font-size: 20px;
    line-height: 1;
}

.input-box .password-toggle:hover:not(:disabled) {
    background: rgba(0, 0, 0, 0.06);
    color: #333;
}

.input-box .password-toggle:focus-visible {
    outline: 2px solid #7494ec;
    outline-offset: 2px;
}

.input-box .password-toggle:disabled {
    cursor: default;
    opacity: 0.9;
}

.input-box--username input {
    padding-right: 76px;
}

.input-box--username > i.bxs-user {
    right: 14px;
}

.input-box--username .field-info-btn {
    position: absolute;
    right: 44px;
    top: 50%;
    transform: translateY(-50%);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    padding: 0;
    border: none;
    border-radius: 999px;
    background: transparent;
    color: #4f46e5;
    cursor: pointer;
    font-size: 20px;
    line-height: 1;
}

.input-box--username .field-info-btn:hover {
    background: rgba(79, 70, 229, 0.1);
    color: #4338ca;
}

.input-box--username .field-info-btn:focus-visible {
    outline: 2px solid #7494ec;
    outline-offset: 2px;
}

.btn {
    width: 100%;
    height: 48px;
    background: #7494ec;
    border-radius: 8px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    border: none;
    cursor: pointer;
    font-size: 16px;
    color: #fff;
    font-weight: 600;
    font-family: inherit;
    margin-top: 8px;
}

.btn:hover {
    filter: brightness(1.05);
}

.btn:disabled {
    opacity: 0.65;
    cursor: not-allowed;
}

.btn.btn--outline {
    background: transparent;
    border: 2px solid #7494ec;
    color: #7494ec;
    box-shadow: none;
}

.btn.btn--outline:hover {
    background: rgba(116, 148, 236, 0.08);
}

.msg {
    margin: 0 0 10px;
    font-size: 13px;
    min-height: 1.2em;
    text-align: center;
    line-height: 1.35;
}

.login-forgot-wrap {
    display: flex;
    justify-content: center;
    margin-top: -6px;
    margin-bottom: 10px;
}

.login-forgot-link {
    font-size: 13px;
    font-weight: 600;
    color: #4f46e5;
    text-decoration: underline;
}

.login-extra-links {
    width: 100%;
    margin-top: 14px;
    margin-left: -40px;
    margin-right: -40px;
    margin-bottom: -36px;
    width: calc(100% + 80px);
    flex-shrink: 0;
}

.login-extra-links__divider {
    height: 1px;
    background: #e5e7eb;
}

.login-extra-links__panel {
    background: #f8f9fb;
    padding: 12px 20px 14px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.login-extra-links__item {
    font-size: 13px;
    font-weight: 600;
    color: #4f46e5;
    text-decoration: none;
    text-align: center;
    line-height: 1.35;
}

.signup-terms {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin: 8px 0 12px;
    text-align: left;
    font-size: 11px;
    line-height: 1.4;
    color: #555;
}

.signup-terms input[type="checkbox"] {
    width: 15px;
    height: 15px;
    margin-top: 1px;
    flex-shrink: 0;
    accent-color: #7494ec;
    cursor: pointer;
}

.signup-terms__label {
    cursor: pointer;
}

.signup-terms a {
    color: #4f46e5;
    font-weight: 500;
    text-decoration: underline;
}

.signup-terms a:hover {
    color: #4338ca;
}

.login-extra-links__item:hover {
    text-decoration: underline;
}

.msg.err {
    color: #b42318;
}

.msg.ok {
    color: #1b7f3a;
}

.toggle-box {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
}

.toggle-box::before {
    content: '';
    position: absolute;
    left: -250%;
    width: 300%;
    height: 100%;
    background: #7494ec;
    border-radius: 150px;
    z-index: 2;
    transition: 1.8s ease-in-out;
    /* Decorative only — must not block form inputs underneath */
    pointer-events: none;
}

.container.active .toggle-box::before {
    left: 50%;
}

.toggle-panel {
    position: absolute;
    width: 50%;
    height: 100%;
    color: #fff;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 2;
    transition: 0.6s ease-in-out;
    /* Extra bottom padding so buttons sit comfortably inside the blue shape */
    padding: 36px 32px 72px;
    text-align: center;
    box-sizing: border-box;
    /* Lets the logo use cqw/cqh relative to this panel, not the viewport */
    container-type: size;
    container-name: toggle-panel;
}

/*
 * Logo must stay inside the blue panel (50% card − padding). Never use a large px cap
 * (e.g. 520px) without cqw — it overflows ~425px-wide panels when CQ is unsupported.
 * Proportional scale: width auto, max-width % of panel + optional cqw; object-fit: contain.
 */
.toggle-logo {
    display: block;
    box-sizing: border-box;
    width: auto;
    max-width: 82%;
    min-width: 0;
    flex-shrink: 1;
    height: auto;
    max-height: min(20vh, 200px);
    object-fit: contain;
    object-position: center top;
    margin: -6px auto 16px;
    transform: translateY(-4px);
    filter: drop-shadow(0 2px 10px rgba(0, 0, 0, 0.2));
}

@supports (width: 1cqw) {
    .toggle-logo {
        /* ~40–45% of blue strip width, never past panel edges */
        max-width: min(88cqw, 82%);
        max-height: min(34cqh, min(24vh, 220px));
    }
}

.toggle-panel h1 {
    color: #fff;
    font-size: 34px;
    margin: 0 0 8px;
}

.toggle-panel p {
    margin-bottom: 28px;
    font-size: 15px;
    opacity: 0.95;
}

.toggle-panel.toggle-left {
    left: 0;
    transition-delay: 1.2s;
}

.container.active .toggle-panel.toggle-left {
    left: -50%;
    transition-delay: 0.6s;
}

.toggle-panel.toggle-right {
    right: -50%;
    transition-delay: 0.6s;
}

.container.active .toggle-panel.toggle-right {
    right: 0;
    transition-delay: 1.2s;
}

.toggle-panel .btn {
    width: 200px;
    height: 48px;
    background: transparent;
    border: 2px solid #fff;
    box-shadow: none;
    margin-top: 0;
    flex-shrink: 0;
}

.toggle-panel .btn:hover {
    background: rgba(255, 255, 255, 0.15);
    filter: none;
}

.toggle-panel .toggle-free-note {
    margin: 12px 0 0;
    font-size: 13px;
    font-weight: 600;
    color: #fff;
    opacity: 0.92;
    letter-spacing: 0.02em;
}

/* Signup success state */
.signup-success {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 32px 28px;
    text-align: center;
    background: #fff;
    z-index: 3;
}

.signup-success[hidden] {
    display: none !important;
}

.signup-success .icon {
    font-size: 52px;
    line-height: 1;
    margin-bottom: 12px;
    color: #1b7f3a;
}

.signup-success h2 {
    font-size: 22px;
    color: #1b7f3a;
    margin-bottom: 12px;
    font-weight: 700;
}

.signup-success p {
    color: #444;
    font-size: 14px;
    line-height: 1.5;
    margin-bottom: 20px;
}

.signup-success .user-ref {
    font-weight: 700;
    color: #222;
}

.signup-success .actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
    max-width: 280px;
}

/* Signup success modal */
.signup-modal {
    position: fixed;
    inset: 0;
    z-index: 12000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.signup-modal[hidden] {
    display: none !important;
}

.signup-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(17, 24, 39, 0.55);
    border: none;
    cursor: pointer;
}

.signup-modal__dialog {
    position: relative;
    width: 100%;
    max-width: 420px;
    background: #fff;
    border-radius: 16px;
    padding: 28px 24px 24px;
    text-align: center;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.25);
    z-index: 1;
}

.signup-modal__icon {
    font-size: 48px;
    line-height: 1;
    margin-bottom: 12px;
    color: #1b7f3a;
}

.signup-modal__title {
    font-size: 22px;
    font-weight: 700;
    color: #1b7f3a;
    margin: 0 0 12px;
}

.signup-modal__text {
    font-size: 14px;
    line-height: 1.55;
    color: #444;
    margin: 0 0 20px;
}

.signup-modal__dialog .btn {
    max-width: 200px;
    margin: 0 auto;
}

.signup-modal__icon--error {
    color: #b42318;
}

.signup-modal__title--error {
    color: #b42318;
}

.signup-modal__icon--info {
    color: #4f46e5;
    font-size: 42px;
    line-height: 1;
}

.signup-modal__icon--info i {
    font-size: inherit;
}

.signup-modal__title--info {
    color: #3730a3;
}

/* Desktop: slightly rounder blue slab so corners feel less tight with tall content */
@media screen and (min-width: 651px) {
    .toggle-box::before {
        border-radius: 160px;
    }
}

@media screen and (max-width: 650px) {
    /*
     * MOBILE = desktop na vertical: --auth-edge define fim da blob, painel e início do form.
     * Blob ::before (único azul) anima top 1.8s; forms só opacity; painéis translateY.
     */
    .container {
        min-height: min(calc(100vh - 100px), 720px);
        height: auto;
        --auth-edge: min(32%, 30vh);
        --auth-blob-size: 300%;
    }

    /* Anular slide horizontal do desktop */
    .form-box,
    .container.active .form-box {
        right: 0 !important;
        left: 0 !important;
        width: 100% !important;
        min-height: 0;
    }

    /* z-index 1: formulários fixos — só opacity anima */
    .form-box {
        align-items: flex-start;
        justify-content: flex-start;
        z-index: 1;
        pointer-events: none;
        transition: opacity 0.6s ease-in-out 1.2s, visibility 0s linear 1s;
    }

    .form-box.login {
        top: var(--auth-edge);
        right: 0;
        bottom: 0;
        left: 0;
        height: auto;
        padding: clamp(10px, 2.5vw, 16px) clamp(16px, 4vw, 20px) clamp(12px, 3vw, 20px);
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
    }

    .container.active .form-box.login {
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
        transition: opacity 0.6s ease-in-out 0.6s, visibility 0s linear 1.2s;
    }

    .form-box.register {
        top: 0;
        right: 0;
        bottom: var(--auth-edge);
        left: 0;
        height: auto;
        padding: clamp(10px, 2.5vw, 16px) clamp(16px, 4vw, 20px) clamp(12px, 3vw, 16px);
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
        transition: opacity 0.6s ease-in-out 0.6s, visibility 0s linear 1.2s;
    }

    .container.active .form-box.register {
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
        transition: opacity 0.6s ease-in-out 1.2s, visibility 0s linear 1.2s;
    }

    /* z-index 2: blob + painéis (como desktop; cobrem form na transição) */
    .toggle-box {
        position: absolute;
        inset: 0;
        width: 100%;
        height: 100%;
        z-index: 2;
        pointer-events: none;
    }

    .toggle-box::before {
        left: 0 !important;
        top: calc(var(--auth-edge) - var(--auth-blob-size));
        width: 100%;
        height: var(--auth-blob-size);
        border-radius: 22vw;
        z-index: 1;
        transition: top 1.8s ease-in-out;
    }

    .container.active .toggle-box::before {
        top: calc(100% - var(--auth-edge));
    }

    .toggle-panel.toggle-left,
    .container.active .toggle-panel.toggle-left {
        left: 0 !important;
        right: 0 !important;
        width: 100%;
    }

    .toggle-panel.toggle-right,
    .container.active .toggle-panel.toggle-right {
        left: 0 !important;
        right: 0 !important;
        width: 100%;
    }

    .toggle-panel {
        position: absolute;
        width: 100%;
        height: var(--auth-edge);
        box-sizing: border-box;
        overflow: hidden;
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        padding: clamp(6px, 1.5vw, 12px) clamp(12px, 3vw, 18px);
        text-align: center;
        container-type: size;
        container-name: toggle-panel;
        z-index: 2;
        pointer-events: auto;
        transition: transform 0.6s ease-in-out;
    }

    .toggle-panel .toggle-logo {
        display: block;
        box-sizing: border-box;
        width: auto;
        min-width: 0;
        max-width: min(82%, 220px);
        height: auto;
        max-height: min(20vh, 72px);
        margin: 0 auto clamp(2px, 1vw, 6px);
        flex-shrink: 1;
        object-fit: contain;
        object-position: center center;
        transform: none;
    }

    @supports (width: 1cqw) {
        .toggle-panel .toggle-logo {
            max-width: min(88cqw, 82%);
            max-height: min(34cqh, min(20vh, 72px));
        }
    }

    .toggle-panel p {
        margin: 0 0 clamp(6px, 1.5vw, 10px);
        font-size: clamp(12px, 3.2vw, 14px);
        line-height: 1.25;
        flex-shrink: 0;
    }

    .toggle-panel .btn {
        width: min(180px, 72%);
        height: clamp(34px, 9vw, 40px);
        min-height: clamp(34px, 9vw, 40px);
        font-size: clamp(12px, 3.2vw, 14px);
        flex-shrink: 0;
    }

    .toggle-panel .toggle-free-note {
        margin: clamp(4px, 1vw, 8px) 0 0;
        font-size: clamp(11px, 2.8vw, 12px);
        flex-shrink: 0;
    }

    .toggle-panel.toggle-left {
        top: 0;
        bottom: auto;
        transform: translateY(0);
        transition-delay: 1.2s;
    }

    .container.active .toggle-panel.toggle-left {
        transform: translateY(-110%);
        transition-delay: 0.6s;
    }

    .toggle-panel.toggle-right {
        top: auto;
        bottom: 0;
        transform: translateY(110%);
        transition-delay: 0.6s;
    }

    .container.active .toggle-panel.toggle-right {
        transform: translateY(0);
        transition-delay: 1.2s;
    }

    .container.active .toggle-panel.toggle-left .toggle-free-note {
        display: none;
    }

    .container:not(.active) .toggle-panel.toggle-left .toggle-free-note {
        opacity: 0;
        animation: auth-free-note-in 0.35s ease 1.35s forwards;
    }

    @keyframes auth-free-note-in {
        to {
            opacity: 0.92;
        }
    }

    /* Formulário: scroll interno se não couber */
    .form-box.login,
    .form-box.register {
        display: flex;
        flex-direction: column;
        min-height: 0;
    }

    .form-box.login form,
    .form-box.register form {
        width: 100%;
        flex: 1 1 auto;
        min-height: 0;
        max-height: 100%;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        display: flex;
        flex-direction: column;
    }

    .form-box.register form {
        padding-bottom: 4px;
    }

    .form-box.register #btnSignup,
    .form-box.login #btnLogin {
        flex-shrink: 0;
        margin-top: 6px;
    }

    .container h1 {
        font-size: clamp(18px, 5vw, 21px);
        margin: 0 0 4px;
        line-height: 1.15;
        flex-shrink: 0;
    }

    .toggle-panel h1 {
        font-size: clamp(1.25rem, 4vw, 1.5rem);
        line-height: 1.15;
    }

    .form-box .input-box,
    .form-box.register .input-box {
        margin: clamp(4px, 1.2vw, 6px) 0;
        flex-shrink: 0;
    }

    .form-box form > .input-box:first-of-type {
        margin-top: 4px;
    }

    .form-box form > #msgSignup,
    .form-box form > #msgLogin {
        margin: 0;
        padding: 0;
        min-height: 0;
        line-height: 1.2;
        flex-shrink: 0;
    }

    .form-box form > #msgSignup:empty,
    .form-box form > #msgLogin:empty {
        display: none;
        height: 0;
        margin: 0;
        overflow: hidden;
    }

    .form-box .input-box input {
        padding: clamp(8px, 2.2vw, 10px) 44px clamp(8px, 2.2vw, 10px) clamp(12px, 3vw, 14px);
        font-size: clamp(12px, 3.2vw, 13px);
    }

    .form-box .input-box--username input {
        padding-right: 72px;
    }

    .form-box .input-box--username .field-info-btn {
        right: 40px;
        width: 26px;
        height: 26px;
        font-size: 18px;
    }

    .form-box .input-box--username > i.bxs-user {
        right: 12px;
        font-size: 17px;
    }

    .form-box .input-box > i {
        font-size: 17px;
        right: 16px;
    }

    .form-box .input-box .password-toggle {
        width: 32px;
        height: 32px;
        font-size: 17px;
    }

    .form-box .btn {
        height: clamp(38px, 10vw, 40px);
        min-height: clamp(38px, 10vw, 40px);
        font-size: clamp(13px, 3.5vw, 14px);
    }

    .form-box .msg {
        min-height: 0;
        margin: 0;
    }

    .form-box .login-forgot-wrap {
        margin-top: 8px;
    }

    .form-box .login-forgot-link {
        font-size: 12px !important;
        flex-shrink: 0;
    }

    .login-extra-links {
        margin-left: clamp(-20px, -4vw, -16px);
        margin-right: clamp(-20px, -4vw, -16px);
        margin-bottom: clamp(-20px, -3vw, -12px);
        width: calc(100% + 2 * clamp(16px, 4vw, 20px));
    }

    .login-extra-links__panel {
        padding: 10px 16px 12px;
    }

    .login-extra-links__item {
        font-size: 12px;
    }

    .signup-terms {
        font-size: 10px;
        gap: 7px;
        margin: 6px 0 10px;
    }

    .signup-terms input[type="checkbox"] {
        width: 14px;
        height: 14px;
    }
}

@media screen and (max-width: 650px) and (max-height: 700px) {
    .container {
        --auth-edge: min(28%, 26vh);
    }

    .form-box .input-box,
    .form-box.register .input-box {
        margin: 4px 0;
    }

    .toggle-panel .toggle-logo {
        max-height: min(16vh, 56px);
    }
}

@media screen and (max-width: 400px) {
    .form-box.login,
    .form-box.register {
        padding: 10px 16px 16px;
    }

    .toggle-panel h1 {
        font-size: 26px;
    }
}
