/* Symples: estilos de index.php (cores do tema do cliente: include/tema.php) */
:root {
    --brand-blue: var(--cor1);
    --brand-blue-hover: #0052cc;
    --brand-purple: var(--cor2);
    --brand-cyan: #00b4d8;
    --bg-light: #f8fafc;
    --surface-white: #ffffff;
    --text-main: #0f172a;
    --text-sub: #64748b;
    --border-subtle: #e2e8f0;
    --status-danger: #dc2626;
    --status-success: #16a34a;
    --status-warning: #d97706;
    --radius-pill: 9999px;
    --radius-card: 24px;
    --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --safe-area-top: env(safe-area-inset-top, 0px);
    --safe-area-bottom: env(safe-area-inset-bottom, 0px);
}

* { 
    box-sizing: border-box; 
    margin: 0; 
    padding: 0; 
    outline: none; 
    -webkit-tap-highlight-color: transparent;
}

html, body {
    height: 100%;
    width: 100%;
    overflow: hidden;
    background-color: var(--bg-light);
    font-family: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
    color: var(--text-main);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    user-select: none;
}

body {
    padding-top: var(--safe-area-top);
    padding-bottom: var(--safe-area-bottom);
}

/* Prevenção de encolhimento de SVG e ícones */
svg, [data-lucide] {
    flex-shrink: 0;
}

.pwa-offline-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: linear-gradient(90deg, #dc2626 0%, #b91c1c 100%);
    color: #ffffff;
    padding: 10px 16px;
    font-size: 12px;
    font-weight: 700;
    text-align: center;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.3);
    transform: translateY(-100%);
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.pwa-offline-bar.active {
    transform: translateY(0);
}

.pwa-update-toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(150%);
    background: var(--text-main);
    color: #ffffff;
    padding: 14px 24px;
    border-radius: var(--radius-pill);
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.3);
    z-index: 9999;
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    font-size: 13px;
    font-weight: 600;
}

.pwa-update-toast.visible {
    transform: translateX(-50%) translateY(0);
}

.pwa-update-btn {
    background: var(--brand-blue);
    color: #ffffff;
    border: none;
    padding: 6px 14px;
    border-radius: var(--radius-pill);
    font-size: 12px;
    font-weight: 800;
    cursor: pointer;
    transition: var(--transition-smooth);
    flex-shrink: 0;
}

.pwa-update-btn:hover {
    background: var(--brand-blue-hover);
}

/* Banner de Instalação PWA Redimensionado e Valorizado */
.pwa-install-banner {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border-subtle);
    padding: 16px 20px;
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0, 102, 255, 0.15);
    z-index: 9990;
    display: none;
    align-items: center;
    gap: 16px;
    animation: fadeInUp 0.5s ease-out forwards;
    max-width: 440px;
    width: calc(100% - 48px);
}

/* Container expandido da logo no banner PWA */
.pwa-install-banner img {
    width: 88px;
    height: 52px;
    border-radius: 12px;
    flex-shrink: 0;
    object-fit: contain;
    background: #ffffff;
    padding: 6px 10px;
    border: 1px solid var(--border-subtle);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.04);
}

.pwa-install-info {
    flex: 1;
    min-width: 0;
}

.pwa-install-info h4 {
    font-size: 14px;
    font-weight: 800;
    color: var(--text-main);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.pwa-install-info p {
    font-size: 12px;
    color: var(--text-sub);
    margin-top: 2px;
    line-height: 1.3;
}

.pwa-install-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.btn-install-now {
    background: var(--brand-blue);
    color: #ffffff;
    border: none;
    padding: 9px 18px;
    border-radius: var(--radius-pill);
    font-size: 12px;
    font-weight: 800;
    cursor: pointer;
    flex-shrink: 0;
}

.btn-install-close {
    background: transparent;
    border: none;
    color: var(--text-sub);
    cursor: pointer;
    padding: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    border-radius: 50%;
}

.btn-install-close:hover {
    background: rgba(0,0,0,0.05);
}

/* Banner iOS */
.pwa-ios-card {
    display: flex;
    flex-direction: column;
    gap: 14px;
    width: 100%;
}

.pwa-ios-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    gap: 12px;
}

.pwa-ios-body {
    background: #f1f5f9;
    padding: 12px 16px;
    border-radius: 14px;
    font-size: 12px;
    color: var(--text-main);
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
}

.pwa-ios-step {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    font-weight: 600;
}

.pwa-ios-step span {
    display: flex;
    align-items: center;
    gap: 6px;
}

.geo-indicator-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    font-weight: 700;
    padding: 6px 12px;
    border-radius: var(--radius-pill);
    background: #f1f5f9;
    color: var(--text-sub);
    transition: var(--transition-smooth);
    flex-shrink: 0;
}

.geo-indicator-pill.active {
    background: #f0fdf4;
    color: var(--status-success);
    border: 1px solid #dcfce7;
}

.geo-indicator-pill.denied {
    background: #fef2f2;
    color: var(--status-danger);
    border: 1px solid #fee2e2;
}

.layout-split {
    display: flex;
    width: 100%;
    height: 100vh;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes pulseGlow {
    0% { transform: scale(0.95); opacity: 0.8; }
    50% { transform: scale(1.05); opacity: 1; }
    100% { transform: scale(0.95); opacity: 0.8; }
}

.pitch-side {
    flex: 1.2;
    position: relative;
    background: linear-gradient(135deg, #f1f5f9 0%, #ffffff 50%, rgb(var(--c1-50)) 100%);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 64px;
    overflow: hidden;
    border-right: 1px solid var(--border-subtle);
    animation: fadeIn 0.8s ease-out forwards;
}

.ambient-glow {
    position: absolute;
    border-radius: 50%;
    filter: blur(120px);
    pointer-events: none;
    opacity: 0.6;
}

.glow-1 {
    top: -15%; 
    left: -15%; 
    width: 550px; 
    height: 550px;
    background: radial-gradient(circle, rgba(0, 102, 255, 0.14) 0%, transparent 70%);
    animation: pulseGlow 6s infinite ease-in-out;
}

.glow-2 {
    bottom: -15%; 
    right: -15%; 
    width: 550px; 
    height: 550px;
    background: radial-gradient(circle, rgba(112, 0, 255, 0.10) 0%, transparent 70%);
    animation: pulseGlow 8s infinite ease-in-out;
}

.pitch-header, .pitch-content, .pitch-footer {
    position: relative;
    z-index: 5;
}

.badge-pill-light {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 8px 20px;
    border-radius: var(--radius-pill);
    background: rgba(255, 255, 255, 0.85);
    border: 1px solid rgba(219, 234, 254, 0.9);
    box-shadow: 0 4px 20px rgba(0, 102, 255, 0.05);
    backdrop-filter: blur(12px);
    color: var(--brand-blue);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 1.2px;
    text-transform: uppercase;
}

.badge-pill-light .pulse-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--brand-blue);
    box-shadow: 0 0 0 0 rgba(0, 102, 255, 0.7);
    animation: pulse-ring 1.5s infinite cubic-bezier(0.66, 0, 0, 1);
    flex-shrink: 0;
}

@keyframes pulse-ring {
    to { box-shadow: 0 0 0 10px rgba(0, 102, 255, 0); }
}

.pitch-content {
    margin-top: auto;
    margin-bottom: auto;
    max-width: 580px;
}

.pitch-content h1 {
    font-size: 52px;
    line-height: 1.08;
    font-weight: 900;
    letter-spacing: -2px;
    color: var(--text-main);
    margin-bottom: 20px;
}

.gradient-text {
    background: linear-gradient(135deg, var(--brand-blue) 0%, var(--brand-purple) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.pitch-content p {
    font-size: 18px;
    color: var(--text-sub);
    line-height: 1.6;
    font-weight: 400;
    margin-bottom: 36px;
}

.workflow-box {
    background: rgba(255, 255, 255, 0.85);
    border: 1px solid rgba(226, 232, 240, 0.9);
    border-radius: var(--radius-card);
    padding: 24px;
    box-shadow: 0 20px 40px -15px rgba(0, 102, 255, 0.05);
    backdrop-filter: blur(16px);
    transition: var(--transition-smooth);
}

.workflow-box:hover {
    box-shadow: 0 25px 50px -12px rgba(0, 102, 255, 0.1);
}

.workflow-title {
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--brand-blue);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.stepper-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: relative;
}

.step-pill {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    position: relative;
    z-index: 2;
    cursor: default;
}

.step-circle {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: #ffffff;
    border: 1.5px solid var(--border-subtle);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-sub);
    transition: var(--transition-smooth);
    flex-shrink: 0;
}

.step-pill:hover .step-circle {
    border-color: var(--brand-blue);
    color: var(--brand-blue);
    transform: scale(1.15);
    box-shadow: 0 8px 16px rgba(0, 102, 255, 0.15);
}

.step-pill:hover .step-label {
    color: var(--brand-blue);
}

.step-label {
    font-size: 11px;
    font-weight: 700;
    color: var(--text-sub);
    transition: var(--transition-smooth);
}

.step-line {
    flex: 1;
    height: 2px;
    background: #e2e8f0;
    margin: 0 6px;
    margin-bottom: 22px;
}

.segment-tags {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px dashed var(--border-subtle);
}

.pill-tag {
    padding: 6px 14px;
    border-radius: var(--radius-pill);
    background: #f1f5f9;
    color: #475569;
    font-size: 11px;
    font-weight: 700;
    transition: var(--transition-smooth);
    cursor: default;
}

.pill-tag:hover {
    background: #e0e7ff;
    color: var(--brand-blue);
    transform: translateY(-3px);
    box-shadow: 0 4px 10px rgba(0, 102, 255, 0.1);
}

.pitch-footer {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-sub);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.form-side {
    flex: 0.85;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 56px;
    background: var(--surface-white);
    position: relative;
}

.form-card {
    width: 100%;
    max-width: 400px;
    animation: fadeInUp 0.6s ease-out forwards;
}

/* Header da marca com visual amplo e refinado */
.brand-header {
    margin-bottom: 32px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

/* Logo no Login: Maior, sem cortes e com iluminação sutil */
.brand-header img {
    height: 64px;
    max-width: 220px;
    width: auto;
    object-fit: contain;
    flex-shrink: 0;
    filter: drop-shadow(0 4px 12px rgba(0, 102, 255, 0.12));
    transition: var(--transition-smooth);
}

.brand-header img:hover {
    transform: scale(1.02);
}

.form-card h2 {
    font-size: 32px;
    font-weight: 900;
    letter-spacing: -1.2px;
    color: var(--text-main);
    margin-bottom: 8px;
}

.form-card p.sub {
    font-size: 14px;
    color: var(--text-sub);
    margin-bottom: 28px;
}

.input-group {
    margin-bottom: 20px;
}

.input-group label {
    display: block;
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-sub);
    margin-bottom: 8px;
    margin-left: 18px;
}

.input-pill-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-pill-wrapper input {
    width: 100%;
    padding: 18px 26px;
    padding-right: 56px;
    border-radius: var(--radius-pill);
    border: 1.5px solid var(--border-subtle);
    background: #f8fafc;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-main);
    transition: var(--transition-smooth);
}

.input-pill-wrapper input:focus {
    background: #ffffff;
    border-color: var(--brand-blue);
    box-shadow: 0 0 0 4px rgba(0, 102, 255, 0.12);
}

.btn-eye-toggle {
    position: absolute;
    right: 14px;
    background: transparent;
    border: none;
    color: #94a3b8;
    cursor: pointer;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-smooth);
    flex-shrink: 0;
}

.btn-eye-toggle:hover {
    color: var(--brand-blue);
    background-color: rgba(0, 102, 255, 0.08);
}

.options-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
    margin-bottom: 32px;
    padding: 0 10px;
}

.options-row label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    color: var(--text-sub);
    font-weight: 600;
    transition: var(--transition-smooth);
}

.options-row label:hover {
    color: var(--text-main);
}

.options-row input[type="checkbox"] {
    accent-color: var(--brand-blue);
    width: 17px;
    height: 17px;
    cursor: pointer;
    transition: transform 0.2s ease;
    flex-shrink: 0;
}

.options-row input[type="checkbox"]:hover {
    transform: scale(1.15);
}

.options-row a {
    color: var(--brand-blue);
    text-decoration: none;
    font-weight: 700;
    transition: var(--transition-smooth);
}

.options-row a:hover {
    text-decoration: underline;
    color: var(--brand-purple);
}

.btn-pill-submit {
    width: 100%;
    padding: 19px 36px;
    border-radius: var(--radius-pill);
    border: none;
    background: linear-gradient(135deg, var(--brand-blue) 0%, var(--brand-purple) 100%);
    color: #ffffff;
    font-size: 15px;
    font-weight: 800;
    letter-spacing: 0.5px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    transition: var(--transition-smooth);
    box-shadow: 0 4px 15px -5px rgba(0, 102, 255, 0.4);
    position: relative;
    overflow: hidden;
}

.btn-pill-submit:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 20px -8px rgba(0, 102, 255, 0.6);
}

.btn-pill-submit:active {
    transform: translateY(1px);
    box-shadow: 0 2px 10px -5px rgba(0, 102, 255, 0.5);
}

.btn-pill-submit.loading {
    pointer-events: none;
    opacity: 0.8;
}

.alert-pill {
    padding: 14px 22px;
    border-radius: var(--radius-pill);
    margin-bottom: 24px;
    font-size: 13px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
}

.alert-error { background: #fef2f2; color: #dc2626; border: 1px solid #fee2e2; }
.alert-success { background: #f0fdf4; color: #16a34a; border: 1px solid #dcfce7; }
.alert-info { background: rgb(var(--c1-50)); color: rgb(var(--c1-600)); border: 1px solid #dbeafe; }

@media (max-width: 980px) {
    body { 
        overflow-y: auto; 
    }
    .layout-split { 
        flex-direction: column; 
        height: auto; 
    }
    .pitch-side { 
        display: none; 
    }
    .form-side { 
        padding: 48px 24px; 
        min-height: 100vh; 
    }
    .brand-header img {
        height: 56px;
    }
    .pwa-install-banner {
        left: 16px;
        right: 16px;
        bottom: 16px;
        width: calc(100% - 32px);
        max-width: none;
    }
}

/* Splash Screen Ampliada */
#pwa-splash-screen {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100vw;
    height: 100vh;
    background-color: #ffffff;
    z-index: 999999;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: opacity 0.4s ease, visibility 0.4s ease;
    -webkit-transition: opacity 0.4s ease, visibility 0.4s ease;
}

#pwa-splash-screen.hidden {
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
}

.splash-logo-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 32px;
}

.splash-logo-glow {
    position: absolute;
    width: 220px;
    height: 220px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(0, 102, 255, 0.22) 0%, rgba(112, 0, 255, 0) 70%);
    animation: splashGlowPulse 2s infinite ease-in-out;
}

.splash-logo-img {
    width: 180px;
    height: auto;
    position: relative;
    z-index: 2;
    object-fit: contain;
    animation: splashFloat 2.5s infinite ease-in-out;
    filter: drop-shadow(0 12px 24px rgba(0, 102, 255, 0.2));
}

.splash-progress-track {
    width: 180px;
    height: 4px;
    background-color: #e2e8f0;
    border-radius: 9999px;
    overflow: hidden;
    position: relative;
}

.splash-progress-bar {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 40%;
    background: linear-gradient(90deg, var(--cor1) 0%, var(--cor2) 100%);
    border-radius: 9999px;
    animation: splashProgressLoop 1.6s infinite ease-in-out;
}

@keyframes splashFloat {
    0%, 100% { transform: translateY(0) scale(1); }
    50% { transform: translateY(-8px) scale(1.03); }
}

@keyframes splashGlowPulse {
    0%, 100% { transform: scale(0.85); opacity: 0.5; }
    50% { transform: scale(1.3); opacity: 0.9; }
}

@keyframes splashProgressLoop {
    0% { left: -40%; width: 30%; }
    50% { width: 60%; }
    100% { left: 100%; width: 30%; }
}

@media display-mode: standalone {
    .brand-header img {
        height: 72px;
    }
    body {
        user-select: none;
    }
}
