/* =========================================================
   GabHelp — Authentication (Login / Register)
   Modern Organic SaaS + Fluid UI + Soft UI
   ========================================================= */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@500;600;700;800&family=DM+Sans:wght@400;500;600;700&family=Caveat:wght@600;700&display=swap');

:root {
    --blue: #149BD7;
    --blue-dark: #0878B5;
    --blue-light: #DDF4FF;

    --background: #F7FCFF;
    --white: #FFFFFFdb;

    --text: #102A43;
    --muted: #607D94;
    --border: #D5E8F3;

    --ink: #E8544C;
    --success: #2FAE66;

    --shadow-sm:
        0 1px 2px rgba(16,42,67,0.05),
        0 2px 6px rgba(16,42,67,0.04);

    --shadow-md:
        0 10px 30px rgba(16,42,67,0.08);

    --shadow-lg:
        0 24px 64px rgba(16,42,67,0.12);

    --radius-lg: 36px;
    --radius-md: 22px;
    --radius-sm: 14px;

    --font-display: 'Plus Jakarta Sans', sans-serif;
    --font-body: 'DM Sans', sans-serif;
    --font-hand: 'Caveat', cursive;

    --container: 1240px;
    --auth-max-width: 1160px;

    --ease: cubic-bezier(0.22, 1, 0.36, 1);
    --dur-slide: 700ms;
    --dur-fade: 420ms;
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
body {
    margin: 0;
    font-family: var(--font-body);
    color: var(--text);
    background: var(--background);
    -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { margin: 0; font-family: var(--font-display); }
p { margin: 0; }
a { color: inherit; }
button { font-family: inherit; cursor: pointer; }
input { font-family: inherit; }

/* ---------- Alerts ---------- */
.alert {
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    margin-bottom: 20px;
    font-size: 0.88rem;
    font-weight: 500;
}
.alert-danger {
    background-color: #FEE2E2;
    color: #991B1B;
    border: 1px solid #FCA5A5;
}

/* ---------- Page shell ---------- */
.auth-page {
    min-height: 100dvh;
    display: flex;
    justify-content: center;
    padding: 16px;
    background:
        radial-gradient(circle at 12% 8%, rgba(20,155,215,0.08), transparent 55%),
        radial-gradient(circle at 92% 96%, rgba(20,155,215,0.07), transparent 55%),
        var(--background);
    overflow-x: hidden;
}

.auth-shell {
    width: 100%;
    max-width: var(--auth-max-width);
    background-color: var(--blue-light);
    border: 1px solid var(--border);
    border-radius: calc(var(--radius-lg) - 10px);
}

/* ---------- Card ---------- */
.auth-card-inner {
    border: 1px solid var(--border);
    border-radius: calc(var(--radius-lg) - 10px);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    background: var(--white);
}

/* ---------- Stage (the swapping area) ---------- */
.stage {
    position: relative;
    display: flex;
    /* Ajuste p/ evitar overflow no desktop: */
    min-height: 650px; 
    height: calc(100dvh - 36px);
}
.panel {
    display: flex;
    justify-content: center;
    flex-direction: column;
    position: relative;
    z-index: 2;
}

.panel-brand {
    padding-left: 5rem;
    background-color: var(--blue-light);
}

/* ============= DESKTOP: horizontal swap ============= */
@media (min-width: 881px) {
    .panel {
        position: absolute;
        top: 0;
        left: 0;
        width: 50%;
        height: 100%;
        transition: transform var(--dur-slide) var(--ease);
        will-change: transform;
    }
    .panel-brand { transform: translateX(0%); }
    .panel-auth  { transform: translateX(100%); }

    .stage.is-register .panel-brand { transform: translateX(100%); }
    .stage.is-register .panel-auth  { transform: translateX(0%); }
}

/* ============= MOBILE: stacked, crossfaded ============= */
@media (max-width: 880px) {
    .stage {
        flex-direction: column;
        height: auto;
        min-height: 0;
    }
    .panel {
        position: relative;
        width: 100%;
        height: auto; /* Permite expansão vertical natural */
        padding: 40px 26px;
        opacity: 1;
        transform: translateY(0);
        transition: opacity 220ms ease, transform 220ms ease;
    }
    .panel-brand { order: 1; display: none; }
    .panel-auth  { order: 2; overflow: visible; }
    .stage.is-register .panel-brand { order: 2; }
    .stage.is-register .panel-auth  { order: 1; }

    .stage.is-switching .panel {
        opacity: 0;
        transform: translateY(10px);
    }

    .divider { display: none; }
}

/* =========================================================
   Branding / benefits side
   ========================================================= */
.brand-content {
    display: flex;
    justify-content: center;
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
    max-width: 460px;
}

.brand-logo {
    font-family: var(--font-hand);
    font-weight: 700;
    font-size: 3rem;
    color: var(--blue-dark);
    line-height: 1;
}

.brand-tagline {
    font-family: var(--font-body);
    font-size: 1.02rem;
    color: var(--muted);
    margin-bottom: 30px;
}

.stats-cluster {
    display: grid;
    grid-template-columns: repeat(2, minmax(120px, 150px));
    gap: 22px 26px;
    margin-bottom: 26px;
}

.stat-chip {
    background: var(--white);
    border: 1.5px solid var(--border);
    box-shadow: var(--shadow-sm);
    color: var(--text);
    transition: transform 260ms var(--ease), box-shadow 260ms var(--ease);
}

.stat-chip:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}

.stat-circle {
    width: 148px;
    height: 148px;
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 10px;
}

.stat-eyebrow {
    font-size: 0.72rem;
    color: var(--muted);
    letter-spacing: 0.02em;
}

.stat-number {
    font-family: var(--font-display);
    font-weight: 800;
    font-size: 2rem;
    color: var(--blue-dark);
    line-height: 1.1;
}

.stat-label {
    font-size: 0.78rem;
    color: var(--muted);
}

.stat-card {
    border-radius: var(--radius-md);
    padding: 20px 18px;
    font-family: var(--font-display);
    background-color: var(--blue);
    font-weight: 600;
    font-size: 0.95rem;
    line-height: 1.35;
    display: flex;
    align-items: center;
}

.stat-users   { justify-self: start;  transform: translateY(6px) rotate(-1.5deg); }
.stat-time    { justify-self: end;    transform: translateY(-8px) rotate(1.5deg); }
.stat-features{ justify-self: start;  transform: translateY(2px) rotate(-1deg); }
.stat-corrections { justify-self: end; transform: translateY(-4px) rotate(1.5deg); }

.brand-more {
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 0.92rem;
    color: var(--blue);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding-bottom: 2px;
    border-bottom: 1.5px solid transparent;
    transition: border-color 200ms var(--ease), color 200ms var(--ease);
}
.brand-more:hover {
    color: var(--blue-dark);
    border-color: var(--blue-dark);
}

/* =========================================================
   Auth (form) side
   ========================================================= */
.panel-auth {
    overflow: hidden;
}

.form-wrap {
    width: 100%;
    max-width: 380px;
    margin: 0 auto;
    display: flex;
    justify-content: center;
    flex-direction: column;
}

@media (min-width: 881px) {
    .form-wrap {
        position: absolute;
        inset: 0;
        margin: 0;
        max-width: none;
        opacity: 0;
        transform: translateY(10px);
        pointer-events: none;
        transition: opacity var(--dur-fade) var(--ease), transform var(--dur-fade) var(--ease);
    }
    .form-wrap.is-active {
        opacity: 1;
        transform: translateY(0);
        pointer-events: auto;
        transition-delay: 180ms;
    }
    .form-wrap:not(.is-active) {
        transition-delay: 0ms;
    }
    .form-wrap > * { max-width: 380px; margin-left: auto; margin-right: auto; width: 100%; }
}

@media (max-width: 880px) {
    .form-wrap { display: none; position: relative; transform: none !important; }
    .form-wrap.is-active { display: flex; }
}

.form-title {
    font-size: 1.7rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 6px;
}

.form-subtitle {
    font-size: 0.95rem;
    color: var(--muted);
    margin-bottom: 30px;
}

.field {
    margin-bottom: 18px;
}

.field-row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    margin-bottom: 8px;
}

.field label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 8px;
}

.field-row label { margin-bottom: 0; }

.field input {
    width: 100%;
    padding: 13px 16px;
    border-radius: var(--radius-sm);
    border: 1.5px solid var(--border);
    background: var(--background);
    color: var(--text);
    font-size: 0.95rem;
    outline: none;
    transition: border-color 200ms var(--ease), box-shadow 200ms var(--ease), background 200ms var(--ease);
}

.field input::placeholder { color: #9AB4C6; }

.field input:hover { border-color: #BFDDEC; }

.field input:focus {
    border-color: var(--blue);
    background: var(--white);
    box-shadow: 0 0 0 4px rgba(20, 155, 215, 0.14);
}

.link-muted {
    font-size: 0.82rem;
    color: var(--blue);
    text-decoration: none;
    font-weight: 500;
}
.link-muted:hover { color: var(--blue-dark); text-decoration: underline; }

.btn {
    border: none;
    border-radius: var(--radius-sm);
    font-weight: 700;
    font-family: var(--font-display);
    font-size: 0.98rem;
    padding: 14px 20px;
    width: 100%;
    transition: transform 180ms var(--ease), box-shadow 180ms var(--ease), background 180ms var(--ease);
}

.btn-primary {
    background: var(--blue);
    color: var(--white);
    box-shadow: 0 10px 24px rgba(20, 155, 215, 0.28);
    margin-top: 6px;
}
.btn-primary:hover { background: var(--blue-dark); transform: translateY(-2px); }
.btn-primary:active { transform: translateY(0); }
.btn-primary:focus-visible,
.btn-google:focus-visible,
.field input:focus-visible,
.link-switch:focus-visible,
.link-muted:focus-visible {
    outline: 3px solid var(--blue-dark);
    outline-offset: 2px;
}

.divider-text {
    display: flex;
    align-items: center;
    align-self: center;
    gap: 14px;
    margin: 22px 0;
    color: var(--muted);
    font-size: 0.82rem;
}
.divider-text::before,
.divider-text::after {
    content: "";
    flex: 1;
    height: 1px;
    background: var(--border);
}

.btn-google {
    background: var(--white);
    color: var(--text);
    border: 1.5px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}
.btn-google:hover { border-color: #BFDDEC; background: var(--background); transform: translateY(-2px); }
.btn-google svg { flex-shrink: 0; }

.switch-text {
    margin-top: 26px;
    text-align: center;
    font-size: 0.88rem;
    color: var(--muted);
}

.link-switch {
    background: none;
    border: none;
    padding: 0;
    color: var(--blue);
    font-weight: 700;
    font-size: 0.88rem;
    margin-left: 4px;
    text-decoration: none;
}
.link-switch:hover { color: var(--blue-dark); text-decoration: underline; }

/* =========================================================
   Responsive fine-tuning
   ========================================================= */
@media (max-width: 880px) {
    .auth-page { padding: 20px 14px; }
    .auth-card-inner { border-radius: calc(var(--radius-md) - 6px); }
    .brand-logo { font-size: 2.4rem; }
    .stats-cluster {
        grid-template-columns: repeat(2, minmax(110px, 1fr));
        gap: 16px;
    }
    .stat-circle { width: 100%; height: 128px; }
    .stat-users, .stat-time, .stat-features, .stat-corrections {
        transform: none;
    }
    .form-title { font-size: 1.45rem; }
}

@media (max-width: 480px) {
    .panel { padding: 32px 20px; }
    .stats-cluster { grid-template-columns: 1fr 1fr; gap: 12px; }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
    .panel,
    .form-wrap,
    .divider,
    .stat-chip,
    .btn,
    .stage.is-switching .panel {
        transition: none !important;
        animation: none !important;
    }
}