@import url('https://fonts.googleapis.com/css2?family=Google+Sans+Flex:wght@400;500;600&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=Montserrat:wght@400;500;600;700&family=PT+Sans:ital,wght@0,400;1,400&display=swap');

/* ── Reset & Base ────────────────────────────────────────────────── */

*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
    overflow-x: hidden;
}

body {
    font-family: 'Google Sans Flex', 'Inter', sans-serif;
    color: #333;
    height: 100vh;
    height: 100dvh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    -webkit-font-smoothing: antialiased;
    background: #fff;
}

a {
    color: inherit;
    text-decoration: none;
    -webkit-tap-highlight-color: transparent;
}

/* ── Page Layout ─────────────────────────────────────────────────── */

.auth-page {
    display: flex;
    flex: 1;
    overflow: hidden;
}

/* ============================================================
   MOBILE LAYOUT (default, < 1024px)
   Auth card takes full screen, white background, no brand panel
   Matches monolith's fullScreen: true popup behavior
   ============================================================ */

/* ── Brand Panel (hidden on mobile) ──────────────────────────────── */

.auth-brand-panel {
    display: none;
}

/* ── Card Container ──────────────────────────────────────────────── */

.auth-card-container {
    display: flex;
    flex: 1;
    flex-direction: column;
    align-items: center;
    padding: 3vh 20px 0;
    overflow-y: auto;
    overflow-x: hidden;
    background: #fff;
}

/* ── Auth Card ───────────────────────────────────────────────────── */

.auth-card {
    width: 100%;
    max-width: 400px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* ── Logo ─────────────────────────────────────────────────────────── */

.auth-logo {
    display: block;
    width: 120px;
    height: auto;
    margin: 0 auto 2.5vh;
}

/* ── Titles (match monolith: #B81D79 magenta) ────────────────────── */

.auth-card h1 {
    font-family: 'Google Sans Flex', sans-serif;
    font-size: 1.25rem;
    font-weight: 500;
    text-align: center;
    color: #B81D79;
    margin-bottom: 3vh;
    width: 100%;
}

.auth-subtitle {
    font-family: 'PT Sans', sans-serif;
    font-size: 15px;
    font-style: italic;
    color: #d4829e;
    text-align: center;
    letter-spacing: 0.5px;
    margin-bottom: 2vh;
    line-height: 1.4;
}

/* Pull subtitle closer to h1 only (cadastro), not h2 (recovery) */
.auth-card h1 + .auth-subtitle {
    margin-top: -1.5vh;
}

.auth-card h2 {
    font-family: 'Google Sans Flex', sans-serif;
    font-size: 1.3rem;
    font-weight: 500;
    text-align: center;
    color: #B81D79;
    margin-bottom: 0.5vh;
    width: 100%;
}

/* ── Testimonial Carousel (match monolith precificador.css L5371-5442) ── */

.auth-testimonial-carousel {
    width: 100%;
    max-width: 400px;
    margin: 0 auto 3vh;
    display: grid;
    overflow: hidden;
    border-left: 3px solid #B81D79;
    border-radius: 0 8px 8px 0;
    background: rgba(184, 29, 121, 0.04);
    min-height: 60px;
}

.testimonial-cadastro-slide {
    grid-area: 1 / 1;
    width: 100%;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    opacity: 0;
    animation: testimonialCadastroFade 25s ease-in-out infinite;
}

.testimonial-cadastro-slide-1 { animation-delay: 0s; }
.testimonial-cadastro-slide-2 { animation-delay: 5s; }
.testimonial-cadastro-slide-3 { animation-delay: 10s; }
.testimonial-cadastro-slide-4 { animation-delay: 15s; }
.testimonial-cadastro-slide-5 { animation-delay: 20s; }

@keyframes testimonialCadastroFade {
    0%, 2%    { opacity: 0; }
    5%, 17%   { opacity: 1; }
    20%, 100% { opacity: 0; }
}

.testimonial-cadastro-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    border: 1.5px solid #e0b3cf;
}

.testimonial-cadastro-avatar-logo {
    object-fit: contain;
    background: #fff;
    padding: 3px;
    border-color: #B81D79;
}

.testimonial-cadastro-content {
    flex: 1;
    min-width: 0;
}

.testimonial-cadastro-text {
    font-family: 'Google Sans Flex', sans-serif;
    font-style: italic;
    font-size: 13px;
    font-weight: 500;
    color: #374151;
    line-height: 1.4;
    margin: 0 0 2px;
}

.testimonial-cadastro-author {
    font-family: 'Google Sans Flex', sans-serif;
    font-size: 11px;
    font-weight: 400;
    color: #9ca3af;
    letter-spacing: 0.3px;
    margin: 0;
}

/* ── Google Sign-In Wrapper (match monolith rlauth.css L220-236) ── */

#google-signin-cadastro-wrapper,
#google-signin-login-wrapper {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    width: 100%;
    max-width: 400px;
    margin: 0 auto;
    padding: 0 0 4px 0;
    overflow: visible;
}

#google-signin-cadastro-wrapper iframe,
#google-signin-login-wrapper iframe {
    width: 100% !important;
}

#google-signin-cadastro,
#google-signin-login {
    display: flex;
    justify-content: center;
    min-height: 44px;
    width: 100%;
}

#google-signin-cadastro > div,
#google-signin-login > div {
    width: 100% !important;
}

#google-signin-cadastro iframe,
#google-signin-login iframe {
    width: calc(100% + 20px) !important;
    margin: -2px -10px !important;
}

/* ── Auth Divider (match monolith rlauth.css L239-258) ───────────── */

.auth-divider {
    display: flex;
    align-items: center;
    width: 100%;
    margin: 20px 0 16px 0;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid #ddd;
}

.auth-divider span {
    padding: 0 14px;
    font-size: 14px;
    color: #666;
    line-height: 2;
    font-family: 'Google Sans Flex', sans-serif;
}

/* ── Form Fields ─────────────────────────────────────────────────── */

.auth-field {
    margin-bottom: 1rem;
    width: 100%;
}

.auth-card form {
    width: 100%;
}

.auth-field label {
    display: block;
    font-family: 'Google Sans Flex', sans-serif;
    font-size: 0.85rem;
    font-weight: 400;
    color: #444;
    margin-bottom: 0.35rem;
}

.auth-field input[type="email"],
.auth-field input[type="password"],
.auth-field input[type="text"] {
    width: 100%;
    height: 40px;
    padding: 0 12px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 0.95rem;
    font-family: 'Google Sans Flex', sans-serif;
    color: #333;
    background: #fff;
    transition: border-color 0.2s, box-shadow 0.2s;
    outline: none;
}

.auth-field input:focus {
    border-color: #1a73e8;
    box-shadow: 0 0 0 2px rgba(26, 115, 232, 0.15);
}

.auth-field input.has-error {
    border-color: #d93025;
}

/* ── Hidden attribute override (CSS display overrides HTML hidden) ─ */

[hidden] {
    display: none !important;
}

/* ── Password wrapper ────────────────────────────────────────────── */

.auth-password-wrapper {
    position: relative;
}

.auth-password-wrapper input {
    padding-right: 44px;
}

.auth-toggle-password {
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    padding: 4px 4px;
    color: #999;
    line-height: 1;
    opacity: 0.6;
    transition: opacity 0.2s;
}

.auth-toggle-password:hover {
    opacity: 1;
}

/* ── Error Messages ──────────────────────────────────────────────── */

.auth-error {
    display: block;
    font-size: 0.78rem;
    color: #d93025;
    margin-top: 0.3rem;
    min-height: 0;
    line-height: 1.3;
}

/* ── Buttons (match monolith: blue #1a73e8, Google-matching) ─────── */

.auth-btn-primary {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    height: 40px;
    background-color: #1a73e8;
    color: #fff;
    border: none;
    border-radius: 4px;
    font-size: 0.95rem;
    font-weight: 500;
    font-family: 'Google Sans Flex', sans-serif;
    cursor: pointer;
    transition: background-color 0.2s;
    margin-top: 8px;
}

.auth-btn-primary:hover {
    background-color: #1558b0;
}

.auth-btn-primary:active {
    background-color: #124a96;
}

.auth-btn-primary:disabled {
    background-color: #94bff5;
    cursor: not-allowed;
}

/* ── Spinner ─────────────────────────────────────────────────────── */

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

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

/* ── Link Buttons (match monolith: #B81D79 magenta) ──────────────── */

.auth-btn-link {
    background: none;
    border: none;
    color: #B81D79;
    font-size: 0.85rem;
    font-family: 'Google Sans Flex', sans-serif;
    font-weight: 500;
    cursor: pointer;
    padding: 0.5rem 0;
    transition: color 0.2s;
}

.auth-btn-link:hover {
    color: #8a1560;
    text-decoration: underline;
}

/* ── Secondary Links Row ─────────────────────────────────────────── */

.auth-secondary-links {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    margin-top: 16px;
    padding-bottom: 8px;
    flex-wrap: wrap;
    gap: 0.5rem;
}

@media (max-width: 400px) {
    .auth-secondary-links {
        flex-direction: column;
        align-items: center;
    }
}

/* ── Legal Text (match monolith rlauth.css L260-276) ─────────────── */

.auth-legal {
    font-family: 'Google Sans Flex', sans-serif;
    font-size: 12px;
    color: #999;
    text-align: center;
    margin: 16px auto 0;
    line-height: 1.4;
    max-width: 400px;
}

.auth-legal a {
    color: #888;
    text-decoration: underline;
}

.auth-legal a:hover {
    color: #666;
}

/* ── Success Message (Premium Animated) ──────────────────────────── */

.auth-success-message {
    text-align: center;
    padding: 2rem 1.5rem;
    background: linear-gradient(135deg, #f0fdfa, #e0f7f5);
    border: 1px solid #b2dfdb;
    border-radius: 16px;
    width: 100%;
    animation: auth-fade-in 0.4s ease;
}

.auth-success-icon {
    display: flex;
    justify-content: center;
    margin-bottom: 1rem;
}

.auth-success-checkmark {
    width: 56px;
    height: 56px;
}

.auth-success-circle {
    stroke: #0d9488;
    stroke-width: 2.5;
    stroke-dasharray: 151;
    stroke-dashoffset: 151;
    animation: auth-circle-draw 0.6s ease-out 0.1s forwards;
}

.auth-success-check {
    stroke: #0d9488;
    stroke-width: 3;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-dasharray: 50;
    stroke-dashoffset: 50;
    animation: auth-check-draw 0.4s ease-out 0.5s forwards;
}

@keyframes auth-circle-draw {
    to { stroke-dashoffset: 0; }
}

@keyframes auth-check-draw {
    to { stroke-dashoffset: 0; }
}

.auth-success-title {
    font-family: 'Google Sans Flex', sans-serif;
    font-size: 1.15rem;
    font-weight: 600;
    color: #0f766e;
    margin-bottom: 0.5rem;
}

.auth-success-text {
    font-family: 'Google Sans Flex', sans-serif;
    font-size: 0.9rem;
    color: #374151;
    line-height: 1.5;
    margin-bottom: 0.75rem;
}

.auth-success-hint {
    font-family: 'Google Sans Flex', sans-serif;
    font-size: 0.78rem;
    color: #9ca3af;
    line-height: 1.4;
}

.auth-success-hint a {
    color: #0d9488;
    text-decoration: none;
    font-weight: 500;
}

.auth-success-hint a:hover {
    text-decoration: underline;
}

/* ── Recovery Panel Transition ───────────────────────────────────── */

.auth-recovery-panel {
    animation: auth-fade-in 0.3s ease;
}

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

/* ── Footer ──────────────────────────────────────────────────────── */

.auth-footer {
    text-align: center;
    font-size: 0.72rem;
    color: #9ca3af;
    line-height: 1.6;
    padding: 6px 16px;
    flex-shrink: 0;
    font-family: 'Inter', sans-serif;
    background: rgba(255, 255, 255, 0.95);
    border-top: 1px solid #f0f0f0;
}

.auth-footer a {
    color: #9ca3af;
    text-decoration: none;
    transition: color 0.2s;
}

.auth-footer a:hover {
    color: #0d9488;
}

.footer-sep {
    margin: 0 6px;
}

/* ── WhatsApp Float ──────────────────────────────────────────────── */

.whatsapp-float {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 56px;
    height: 56px;
    background: #25d366;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 16px rgba(37, 211, 102, 0.4);
    z-index: 100;
    transition: all 0.3s ease;
}

.whatsapp-float:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 24px rgba(37, 211, 102, 0.5);
}

.whatsapp-float-icon {
    width: 30px;
    height: 30px;
    fill: #fff;
}

/* ============================================================
   DESKTOP (1024px+) — Two-column layout matching /comecar/
   ============================================================ */

@media (min-width: 1024px) {

    /* ── Brand Panel (match /comecar/ exactly) ── */
    .auth-brand-panel {
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: flex-end;
        text-align: right;
        width: 50%;
        padding: 40px 60px 40px 40px;
        background:
            radial-gradient(ellipse at 30% 40%, rgba(13, 148, 136, 0.06) 0%, transparent 60%),
            radial-gradient(ellipse at 70% 80%, rgba(244, 114, 182, 0.04) 0%, transparent 50%),
            linear-gradient(160deg, #f0fdfa 0%, #f8fafc 50%, #fdf2f8 100%);
        position: relative;
    }

    .auth-brand-panel::after {
        content: '';
        position: absolute;
        right: 0;
        top: 10%;
        height: 80%;
        width: 1px;
        background: linear-gradient(180deg, transparent, #d1d5db, transparent);
    }

    .auth-brand-panel .brand-logo-desktop {
        width: 180px;
        height: auto;
        margin-bottom: 24px;
    }

    .auth-brand-panel .brand-headline {
        font-family: 'Inter', sans-serif;
        font-size: 2.4rem;
        font-weight: 800;
        color: #1a1a1a;
        line-height: 1.25;
        margin-bottom: 16px;
    }

    .auth-brand-panel .brand-headline .highlight-teal {
        color: #0d9488;
    }

    .auth-brand-panel .brand-subtext {
        font-family: 'Montserrat', sans-serif;
        font-size: 1.1rem;
        color: #6b7280;
        line-height: 1.7;
        margin-bottom: 24px;
    }

    .auth-brand-panel .brand-social-proof-desktop {
        display: flex;
        align-items: center;
        gap: 10px;
        background: rgba(255, 255, 255, 0.7);
        border: 1px solid #b2dfdb;
        border-radius: 12px;
        padding: 14px 24px;
    }

    .auth-brand-panel .brand-social-proof-desktop span {
        font-size: 0.9rem;
        font-weight: 600;
        color: #0d7d78;
    }

    .auth-brand-panel .brand-social-proof-desktop .proof-dot {
        width: 5px;
        height: 5px;
        border-radius: 50%;
        background: #0d9488;
    }

    /* ── Card Container on desktop: right panel ── */
    .auth-card-container {
        width: 50%;
        padding: 40px 40px 40px 60px;
        justify-content: center;
        align-items: flex-start;
        overflow-y: hidden;
    }

    /* ── Hide mobile logo on desktop (brand panel shows it) ── */
    .auth-card .auth-logo {
        display: none;
    }

    /* ── Desktop title size restore ── */
    .auth-card h1 {
        font-size: 1.5rem;
        margin-bottom: 5vh;
    }

    /* ── Footer ── */
    .auth-footer {
        width: 100%;
        max-width: none;
        padding: 10px 24px;
        font-size: 0.75rem;
    }
}

/* Large desktop fine-tuning */
@media (min-width: 1440px) {
    .auth-brand-panel {
        padding: 80px 80px 80px 100px;
    }

    .auth-brand-panel .brand-headline {
        font-size: 2.8rem;
    }

    .auth-card-container {
        padding: 80px 100px 80px 80px;
    }
}

/* ── Hide brand panel on mobile and tablet ── */
@media (max-width: 1023px) {
    body {
        height: auto;
        min-height: 100vh;
        min-height: 100dvh;
        overflow: auto;
    }

    .auth-brand-panel {
        display: none;
    }
}
