/* =============================================
   LANDING PAGE — full-screen immersive design
   ============================================= */

*,
*::before,
*::after {
    box-sizing: border-box;
}

.landing-body {
    margin: 0;
    font-family: "Trebuchet MS", "Segoe UI", "Helvetica Neue", sans-serif;
    min-height: 100dvh;
    overflow: hidden;
}

/* --- Background full-screen photo --- */
.landing-bg {
    position: fixed;
    inset: 0;
    z-index: 0;
}

.landing-bg-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: 40% 30%;
    display: block;
}

.landing-overlay {
    position: absolute;
    inset: 0;
    background:
        linear-gradient(to right,
            rgba(8, 2, 5, 0.05) 0%,
            rgba(8, 2, 5, 0.15) 40%,
            rgba(8, 2, 5, 0.70) 65%,
            rgba(8, 2, 5, 0.90) 100%),
        linear-gradient(to bottom,
            rgba(8, 2, 5, 0.50) 0%,
            transparent 20%,
            transparent 75%,
            rgba(8, 2, 5, 0.60) 100%);
}

/* --- Wrapper over the bg --- */
.landing-wrap {
    position: relative;
    z-index: 1;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
}

.landing-index .topbar {
    background: transparent;
    border-bottom-color: transparent;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
}

/* Legacy class kept for any old cache; mirror .topbar geometry. */
.landing-header {
    display: flex;
    align-items: center;
    padding: 18px 48px;
    min-height: 76px;
    box-sizing: border-box;
}

/* --- Main content area --- */
.landing-main {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 48px 32px;
    gap: 60px;
    max-width: 1100px;
    margin: 0 auto;
    width: 100%;
}

/* --- Tagline (left side) --- */
.landing-tagline {
    flex: 1;
    max-width: 520px;
    color: #fff;
}

.landing-tagline h1 {
    font-size: clamp(1.8rem, 3vw, 3rem);
    font-weight: 900;
    line-height: 1.1;
    margin: 0 0 14px;
    letter-spacing: -0.5px;
    text-shadow: 0 2px 30px rgba(0, 0, 0, 0.6);
}

.landing-tagline p {
    font-size: 1rem;
    color: rgba(255, 220, 232, 0.80);
    margin: 0;
    line-height: 1.6;
    text-shadow: 0 1px 8px rgba(0, 0, 0, 0.5);
}

/* logo inline (mobile only) */
.brand-mobile {
    display: none;
}

/* --- Auth card --- */
.landing-card {
    width: 340px;
    flex-shrink: 0;
    background: rgba(16, 5, 10, 0.72);
    backdrop-filter: blur(24px) saturate(1.4);
    -webkit-backdrop-filter: blur(24px) saturate(1.4);
    border: 1px solid rgba(255, 100, 150, 0.22);
    border-radius: 24px;
    padding: 32px 28px;
    box-shadow:
        0 32px 80px rgba(0, 0, 0, 0.55),
        inset 0 1px 0 rgba(255, 180, 210, 0.12);
}

/* --- Tabs inside card --- */
.landing-tabs {
    display: flex;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 14px;
    padding: 4px;
    gap: 4px;
    margin-bottom: 24px;
}

.landing-tab {
    flex: 1;
    padding: 11px 0;
    border: none;
    border-radius: 10px;
    background: transparent;
    color: rgba(255, 220, 232, 0.6);
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    transition: background 200ms ease, color 200ms ease;
    font-family: inherit;
}

.landing-tab:hover {
    color: #fff;
    background: rgba(255, 79, 123, 0.12);
}

.landing-tab-active {
    background: linear-gradient(135deg, #ff4f7b, #d4004e);
    color: #fff !important;
    box-shadow: 0 4px 18px rgba(255, 56, 114, 0.4);
}

/* --- Form fields --- */
.landing-card .form-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.landing-card input[type="email"],
.landing-card input[type="password"] {
    width: 100%;
    background: rgba(255, 255, 255, 0.07);
    border: 1px solid rgba(255, 150, 185, 0.2);
    border-radius: 12px;
    padding: 14px 16px;
    color: #fff;
    font-size: 0.97rem;
    font-family: inherit;
    outline: none;
    transition: border-color 180ms ease, background 180ms ease, box-shadow 180ms ease;
}

.landing-card input::placeholder {
    color: rgba(255, 200, 220, 0.4);
}

.landing-card input:focus {
    border-color: rgba(255, 79, 123, 0.7);
    background: rgba(255, 255, 255, 0.10);
    box-shadow: 0 0 0 3px rgba(255, 79, 123, 0.18);
}

/* --- Submit button --- */
.landing-card .btn-primary {
    width: 100%;
    padding: 15px;
    border: none;
    border-radius: 12px;
    background: linear-gradient(135deg, #ff4f7b, #d4004e);
    color: #fff;
    font-size: 1rem;
    font-weight: 800;
    font-family: inherit;
    letter-spacing: 0.3px;
    cursor: pointer;
    box-shadow: 0 8px 28px rgba(255, 56, 114, 0.45);
    transition: filter 180ms ease, transform 180ms ease;
    margin-top: 4px;
}

.landing-card .btn-primary.is-loading {
    position: relative;
    pointer-events: none;
    opacity: 0.78;
}

/* Social-auth anchors: show the spinner visual but do NOT set
   `pointer-events: none`. Applying it via JS during a tap (even on the next
   tick) makes Chrome Mobile / iOS Safari treat the link as non-interactive
   and cancel the queued navigation — the user sees the spinner flash and the
   page sits there. Re-click protection lives in JS (`dataset.loading`). */
.social-auth-button.is-loading {
    position: relative;
    opacity: 0.78;
}

.landing-card .btn-primary.is-loading::after,
.social-auth-button.is-loading::after {
    content: '';
    position: absolute;
    left: 50%;
    top: 50%;
    margin-left: -9px;
    margin-top: -9px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.42);
    border-top-color: #fff;
    animation: landingSpin 0.75s linear infinite;
}

/* Google's placeholder has a light/white background, so the white spinner
   is invisible. Use a dark spinner specifically for it. */
.social-auth-button--google-ph.is-loading::after {
    border: 2px solid rgba(60, 64, 67, 0.25);
    border-top-color: #3c4043;
}

.landing-card .btn-primary.is-loading {
    color: transparent;
}

.social-auth-button.is-loading > * {
    visibility: hidden;
}

.landing-card .btn-primary:hover {
    filter: brightness(1.08);
    transform: translateY(-1px);
}

.google-login-form {
    display: none;
}

.auth-divider {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 14px 0 4px;
    color: #666;
    font-size: .8rem;
}
.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: rgba(255,255,255,.12);
}

.auth-buttons-container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    margin-top: 14px;
    height: 40px;
    overflow: hidden;
}

.google-auth-row {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 40px;
    height: 40px;
    flex-shrink: 0;
    overflow: hidden;
    margin: 0;
}

.google-auth-row iframe {
    color-scheme: light;
}

.facebook-login-form {
    display: none;
}

.facebook-auth-row {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 40px;
    height: 40px;
    flex-shrink: 0;
    margin: 0;
}

.social-auth-button {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    cursor: pointer;
    text-decoration: none;
    user-select: none;
    transition: filter 180ms ease, box-shadow 180ms ease;
    /* Eliminate the 300ms tap delay and disable double-tap-zoom on these
       buttons so the first tap on mobile always fires `click`. */
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

.social-auth-button--google-ph {
    background: #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18);
    cursor: pointer;
}

.social-auth-button--facebook {
    background: #1877f2;
    color: #fff;
    box-shadow: 0 2px 8px rgba(24, 119, 242, 0.3);
}

/* Hover styles are scoped to devices that actually have hover (mouse) — on
   touch devices, `:hover` triggers sticky-hover and forces the user to tap
   twice. `(hover: hover)` + `(pointer: fine)` matches desktop/laptop only. */
@media (hover: hover) and (pointer: fine) {
    .social-auth-button--google-ph:hover {
        filter: brightness(0.97);
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.28);
    }
    .social-auth-button--facebook:hover {
        filter: brightness(1.05);
        box-shadow: 0 4px 12px rgba(24, 119, 242, 0.45);
    }
}

/* Touch feedback — replace hover with active state for tap feedback. */
.social-auth-button:active {
    filter: brightness(0.95);
}

.auth-legal-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    margin-top: 16px;
    color: rgba(255, 230, 238, 0.68);
    font-size: 0.82rem;
    line-height: 1.35;
}

.auth-legal-links a {
    color: rgba(255, 230, 238, 0.9);
    text-decoration: none;
}

.auth-legal-links a:hover {
    color: #fff;
}

@keyframes landingSpin {
    to {
        transform: rotate(360deg);
    }
}

/* ── Social-only login hero ──────────────────────────────────────────────────── */
.auth-social-hero {
    text-align: center;
    padding: 8px 0 22px;
}

.auth-social-hero-icon {
    margin-bottom: 10px;
    opacity: 0.85;
}

.auth-social-hero-title {
    font-size: 1.15rem;
    font-weight: 800;
    color: #fff;
    margin: 0 0 6px;
    letter-spacing: -0.2px;
}

.auth-social-hero-sub {
    font-size: 0.84rem;
    color: rgba(255, 210, 228, 0.7);
    margin: 0;
    line-height: 1.45;
}

/* ── Social-only: rótulos dos botões (ocultos no modo normal) ────────────────── */
.social-auth-label {
    display: none;
    font-size: 0.94rem;
    font-weight: 600;
    white-space: nowrap;
}

/* ── Social-only: botões largos (full-width com texto) ───────────────────────── */
.auth-buttons-container--full {
    flex-direction: column;
    height: auto;
    overflow: visible;
    gap: 10px;
    margin-top: 0;
}

.auth-buttons-container--full .google-auth-row,
.auth-buttons-container--full .facebook-auth-row {
    width: 100%;
    height: 50px;
    overflow: hidden;
    border-radius: 12px;
}

.auth-buttons-container--full .social-auth-button--google-ph {
    width: 100%;
    height: 50px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.95);
    color: #3c4043;
    gap: 10px;
    padding: 0 18px;
    justify-content: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.25);
    font-family: inherit;
}

.auth-buttons-container--full .social-auth-button--google-ph .social-auth-label {
    display: inline;
    color: #3c4043;
}

.auth-buttons-container--full .social-auth-button--facebook {
    width: 100%;
    height: 50px;
    border-radius: 12px;
    gap: 10px;
    padding: 0 18px;
    justify-content: center;
    font-family: inherit;
}

.auth-buttons-container--full .social-auth-button--facebook .social-auth-label {
    display: inline;
}

/* --- Error alert --- */
.landing-card .alert {
    border-radius: 10px;
    padding: 11px 14px;
    font-size: 0.9rem;
    margin-bottom: 8px;
}

.landing-card .alert.error {
    background: rgba(255, 60, 90, 0.18);
    border: 1px solid rgba(255, 80, 110, 0.45);
    color: #ffb3c3;
}

/* =============================================
   RESPONSIVE
   ============================================= */

/* Laptop pequeno (1100px → 861px): mantém layout 2 colunas, mais compacto */
@media (max-width: 1100px) {
    .landing-main {
        padding: 0 36px 48px;
        gap: 40px;
    }

    .landing-bg-img {
        object-position: 45% 50%;
    }
}

/* Tablet / Mobile (≤860px): empilha vertical, foto no topo, conteúdo embaixo */
@media (max-width: 860px) {
    .landing-body {
        overflow: auto;
    }

    .landing-wrap {
        min-height: auto;
    }

    /* NOTE: object-position for the bg image is intentionally NOT set here.
       The previous "50% 75%" rule cropped the model out of frame on iPad
       portrait. Phones get the bottom-biased crop via the ≤640px block
       further down; tablets inherit the centered position from the ≤1100px
       rule above. */

    .landing-overlay {
        background:
            linear-gradient(to bottom,
                rgba(8, 2, 5, 0.30) 0%,
                rgba(8, 2, 5, 0.10) 25%,
                rgba(8, 2, 5, 0.55) 60%,
                rgba(8, 2, 5, 0.85) 100%);
    }

    .landing-header {
        display: none;
    }

    .landing-main {
        flex-direction: column;
        align-items: center;
        justify-content: flex-start;
        padding: 18px 24px 24px;
        gap: 12px;
        min-height: calc(100dvh - var(--header-h, 76px));
    }

    .brand-mobile {
        display: none;
    }

    .brand-mobile .brand-logo {
        width: 52px;
        height: 52px;
    }

    .landing-tagline {
        flex: 0 0 auto;
        text-align: center;
        max-width: 100%;
    }

    .landing-tagline h1 {
        font-size: clamp(1.4rem, 5.5vw, 1.9rem);
        margin-bottom: 8px;
    }

    .landing-tagline p {
        font-size: 0.95rem;
    }

    .landing-card {
        width: 100%;
        max-width: 420px;
        padding: 24px 22px;
    }

    .landing-tabs {
        margin-bottom: 18px;
    }
}

/* Phones only: shift the bg focal point to the bottom of the frame so the
   model stays visually grounded behind the auth card on small screens.
   iPad/tablet portrait keeps the centered crop from the ≤1100px block. */
@media (max-width: 640px) {
    .landing-bg-img {
        object-position: 50% 75%;
    }
}

/* Mobile estreito (≤480px): mais compacto ainda */
@media (max-width: 480px) {
    .landing-main {
        padding: 12px 16px 24px;
        gap: 8px;
        min-height: calc(100dvh - 60px);
    }

    .brand-mobile {
        display: none;
    }

    .brand-mobile .brand-logo {
        width: 44px;
        height: 44px;
    }

    .landing-tagline h1 {
        font-size: clamp(1.25rem, 6vw, 1.6rem);
        margin-bottom: 6px;
    }

    .landing-tagline p {
        font-size: 0.88rem;
        line-height: 1.45;
    }

    .landing-card {
        padding: 20px 18px;
        border-radius: 20px;
    }

    .landing-card input[type="email"],
    .landing-card input[type="password"] {
        padding: 12px 14px;
        font-size: 0.95rem;
    }

    .landing-card .btn-primary {
        padding: 13px;
    }
}

/* Mobile muito baixo (altura ≤640px): reduz paddings verticais */
@media (max-width: 860px) and (max-height: 640px) {
    .landing-main {
        gap: 8px;
        padding-top: 10px;
        padding-bottom: 12px;
        min-height: calc(100dvh - 60px);
    }

    .landing-tagline h1 {
        font-size: 1.3rem;
        margin-bottom: 4px;
    }

    .landing-tagline p {
        font-size: 0.85rem;
    }

    .landing-card {
        padding: 16px 18px;
    }

    .landing-tabs {
        margin-bottom: 12px;
    }
}
