/* ==========================================================================
   GERADOR DE MOLDURAS PARA CANDIDATOS - COSTA NETO DEPUTADO FEDERAL
   Theme: Official Campaign Blue (#002F86) & Yellow (#F3BE00)
   Design System: Glassmorphic Cards, Equal Height Panels & Zero Layout Shift
   ========================================================================== */

:root {
    /* Campaign Palette */
    --brand-blue: #002F86;
    --brand-blue-hover: #002266;
    --brand-blue-light: #003db3;
    --brand-yellow: #F3BE00;
    --brand-yellow-hover: #d9aa00;
    --brand-yellow-light: #fef08a;
    --brand-white: #ffffff;
    --brand-dark-navy: #091e42;
    --brand-green: #10b981;
    
    /* Backgrounds */
    --bg-page: #f8fafc;
    --bg-card: #ffffff;
    --bg-card-glass: rgba(255, 255, 255, 0.95);

    /* Text */
    --text-primary: #0f172a;
    --text-sub: #475569;
    --text-muted: #94a3b8;
    
    /* Borders & Shadows */
    --border-light: #e2e8f0;
    --border-brand: rgba(0, 47, 134, 0.15);
    --shadow-soft: 0 4px 20px -2px rgba(0, 47, 134, 0.08);
    --shadow-hover: 0 10px 30px -4px rgba(0, 47, 134, 0.16);
    --shadow-yellow: 0 4px 14px rgba(243, 190, 0, 0.35);
    --shadow-white-stage: 0 8px 32px rgba(0, 0, 0, 0.08);

    /* Radii */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 18px;
    --radius-pill: 9999px;
}

/* Base Reset & Typography */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html, body {
    width: 100%;
    min-height: 100vh;
    font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-page);
    color: var(--text-primary);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

body {
    display: flex;
    flex-direction: column;
}

/* Common Components & Buttons */
.btn {
    font-family: inherit;
    font-weight: 800;
    border-radius: var(--radius-pill);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    text-decoration: none;
    outline: none;
    user-select: none;
}

.btn-lg {
    font-size: 1rem;
    padding: 0.95rem 1.85rem;
    min-height: 52px;
}

.btn-md {
    font-size: 0.95rem;
    padding: 0.8rem 1.25rem;
    min-height: 48px;
}

.btn-primary {
    background: var(--brand-blue);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.15);
    box-shadow: 0 4px 14px rgba(0, 47, 134, 0.25);
}

.btn-primary:hover {
    background: var(--brand-blue-hover);
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(0, 47, 134, 0.35);
}

.btn-secondary {
    background: #f1f5f9;
    color: var(--brand-blue);
    border: 1px solid #cbd5e1;
    font-weight: 800;
}

.btn-secondary:hover {
    background: #e2e8f0;
    border-color: var(--brand-blue);
}

.btn-full {
    width: 100%;
}

/* --- TOP SITE HEADER (idêntico à página inicial) --- */
.site-header {
    background: var(--brand-blue);
    border-bottom: 2px solid var(--brand-yellow);
    box-shadow: 0 2px 24px rgba(0, 12, 40, 0.35);
    position: sticky;
    top: 0;
    z-index: 100;
}

.site-nav {
    max-width: 1160px;
    margin: 0 auto;
    width: 100%;
    padding: 0 24px;
    height: 72px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.site-logo {
    display: inline-flex;
    align-items: center;
}

.site-logo-img {
    height: 44px;
    width: auto;
    display: block;
}

.site-menu {
    display: flex;
    align-items: center;
    gap: 26px;
    font-family: 'Gabarito', var(--font-sans, inherit);
}

.site-menu a:not(.site-cta) {
    color: #dbe6f0;
    font-size: 14.5px;
    font-weight: 500;
    position: relative;
    text-decoration: none;
    transition: color 0.2s ease;
}

.site-menu a:not(.site-cta)::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: -6px;
    width: 100%;
    height: 2px;
    background: var(--brand-yellow);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.25s cubic-bezier(0.22, 1, 0.36, 1);
}

.site-menu a:not(.site-cta):hover {
    color: #fff;
}

.site-menu a:not(.site-cta):hover::after {
    transform: scaleX(1);
}

/* CTA dourado — texto/seta em azul */
.site-cta {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: var(--brand-yellow);
    color: var(--brand-blue);
    font-family: 'Gabarito', inherit;
    font-weight: 700;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    border-radius: 12px;
    text-decoration: none;
    transition: transform 0.25s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.25s ease;
}

.site-cta:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 30px rgba(14, 42, 71, 0.28);
}

/* Burger (mobile) */
.site-burger {
    display: none;
    background: none;
    border: none;
    padding: 8px;
}

.site-burger-box {
    display: block;
    width: 26px;
    height: 18px;
    position: relative;
}

.site-burger-box i {
    position: absolute;
    left: 0;
    width: 100%;
    height: 2.5px;
    border-radius: 3px;
    background: #fff;
    transition: transform 0.3s ease, opacity 0.3s ease, top 0.3s ease;
}

.site-burger-box i:nth-child(1) { top: 0; }
.site-burger-box i:nth-child(2) { top: 8px; }
.site-burger-box i:nth-child(3) { top: 16px; }

.site-burger.is-open .site-burger-box i:nth-child(1) { top: 8px; transform: rotate(45deg); }
.site-burger.is-open .site-burger-box i:nth-child(2) { opacity: 0; }
.site-burger.is-open .site-burger-box i:nth-child(3) { top: 8px; transform: rotate(-45deg); }

@media (max-width: 860px) {
    .site-burger {
        display: block;
        z-index: 2;
    }
    .site-menu {
        position: fixed;
        inset: 72px 0 auto 0;
        flex-direction: column;
        align-items: stretch;
        gap: 4px;
        padding: 20px 24px 28px;
        background: var(--brand-blue);
        border-bottom: 1px solid rgba(255, 255, 255, 0.08);
        box-shadow: 0 20px 40px rgba(0, 0, 0, 0.35);
        transform: translateY(-12px);
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.28s ease, transform 0.28s cubic-bezier(0.22, 1, 0.36, 1), visibility 0.28s;
    }
    .site-menu a {
        padding: 13px 6px;
        font-size: 16px;
        border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    }
    .site-menu a:not(.site-cta)::after { display: none; }
    .site-cta {
        margin-top: 12px;
        justify-content: center;
    }
    .site-menu.is-open {
        transform: translateY(0);
        opacity: 1;
        visibility: visible;
    }
}

/* --- MAIN APP WORKSPACE --- */
.app-main {
    flex: 1;
    display: grid;
    grid-template-columns: 320px 1fr 340px;
    gap: 1.75rem;
    padding: 2rem 1.5rem;
    max-width: 1420px;
    margin: 0 auto;
    width: 100%;
    align-items: start;
}

/* --- LEFT SIDEBAR --- */
.desktop-brand-sidebar {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    width: 100%;
}

.sidebar-header-outer {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding: 0.25rem;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    align-self: flex-start;
    background: rgba(243, 190, 0, 0.18);
    color: #92400e;
    border: 1px solid rgba(243, 190, 0, 0.4);
    padding: 4px 12px;
    border-radius: var(--radius-pill);
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.5px;
}

.hero-main-title {
    font-size: 1.95rem;
    font-weight: 900;
    color: var(--brand-blue);
    line-height: 1.2;
    letter-spacing: -0.5px;
}

.hero-subtitle {
    font-size: 0.92rem;
    color: var(--text-sub);
    line-height: 1.6;
    font-weight: 500;
}

.highlight-candidate {
    color: var(--brand-blue);
    font-weight: 800;
    background: rgba(243, 190, 0, 0.25);
    padding: 1px 6px;
    border-radius: 4px;
}

.subtitle-break {
    display: block;
    margin-top: 0.35rem;
}

.sidebar-card {
    background: #ffffff;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    box-shadow: var(--shadow-soft);
}

.steps-guide-box {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: var(--radius-md);
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.steps-guide-box h3 {
    font-size: 0.95rem;
    font-weight: 800;
    color: var(--brand-blue);
}

.steps-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.steps-list li {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    font-size: 0.84rem;
    color: var(--text-sub);
    line-height: 1.4;
}

.step-num {
    background: var(--brand-blue);
    color: #ffffff;
    font-weight: 900;
    font-size: 0.78rem;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-top: 1px;
}

/* --- CANVAS VIEWPORT STAGE --- */
.viewport-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    width: 100%;
    gap: 0.75rem;
}

/* Barra Superior de Ações (FORA DA IMAGEM) */
.viewport-toolbar {
    width: 100%;
    max-width: 600px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 12px;
    background: #ffffff;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-soft);
    box-sizing: border-box;
}

.toolbar-history-group {
    display: flex;
    align-items: center;
    gap: 6px;
}

.btn-icon-toolbar {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    color: var(--text-sub);
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    font-family: inherit;
    font-size: 0.76rem;
    font-weight: 700;
    transition: all 0.2s ease;
}

.btn-icon-toolbar:hover:not(:disabled) {
    color: var(--brand-blue);
    background: #eff6ff;
    border-color: var(--brand-blue);
}

.btn-icon-toolbar:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.toolbar-res-badge {
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(0, 47, 134, 0.08);
    border: 1px solid rgba(0, 47, 134, 0.15);
    padding: 4px 10px;
    border-radius: var(--radius-pill);
    font-size: 0.74rem;
    font-weight: 800;
    color: var(--brand-blue);
    letter-spacing: 0.3px;
}

.res-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--brand-blue);
}

.canvas-box {
    position: relative;
    width: 100%;
    max-width: 520px;
    aspect-ratio: 1 / 1;
    background: transparent;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-white-stage);
    border: 1px solid var(--border-light);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: aspect-ratio 0.25s ease, max-width 0.25s ease, border-radius 0.25s ease, box-shadow 0.25s ease;
}

.canvas-box.is-story {
    aspect-ratio: 9 / 16;
    max-width: 320px;
}

.canvas-box.is-circle {
    aspect-ratio: 1 / 1;
    max-width: 520px;
    border-radius: 50%;
    box-shadow: 0 10px 36px rgba(0, 47, 134, 0.18);
}

#mainCanvas {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    cursor: grab;
    touch-action: none;
    user-select: none;
    -webkit-user-select: none;
}

#mainCanvas.grabbing {
    cursor: grabbing;
}

/* Empty Canvas Overlay */
.empty-overlay {
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    color: #0f172a;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 2rem 1.5rem;
    gap: 0.85rem;
    z-index: 10;
    transition: opacity 0.25s ease, visibility 0.25s ease;
}

.empty-overlay.hidden {
    display: none;
    opacity: 0;
    visibility: hidden;
}

.empty-icon-wrap {
    position: relative;
    width: 68px;
    height: 68px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 2px;
}

.empty-icon {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(0, 47, 134, 0.12) 0%, rgba(243, 190, 0, 0.15) 100%);
    border: 2px solid var(--border-brand);
    color: var(--brand-blue);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 2;
    box-shadow: 0 4px 16px rgba(0, 47, 134, 0.12);
}

.empty-icon-pulse {
    position: absolute;
    inset: -4px;
    border-radius: 50%;
    border: 2px solid var(--brand-yellow);
    opacity: 0.5;
    animation: ripplePulse 2.4s cubic-bezier(0.25, 1, 0.5, 1) infinite;
    z-index: 1;
}

@keyframes ripplePulse {
    0% { transform: scale(0.9); opacity: 0.8; }
    100% { transform: scale(1.4); opacity: 0; }
}

.empty-title {
    font-size: 1.25rem;
    font-weight: 900;
    color: var(--brand-dark-navy);
    letter-spacing: -0.01em;
    line-height: 1.25;
}

.empty-subtitle {
    font-size: 0.88rem;
    color: var(--text-sub);
    max-width: 320px;
    line-height: 1.5;
}

.btn-empty-upload {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: linear-gradient(135deg, var(--brand-blue) 0%, #0c4ec2 100%);
    color: #ffffff;
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 800;
    letter-spacing: 0.02em;
    border: none;
    border-radius: var(--radius-pill);
    padding: 13px 26px;
    cursor: pointer;
    box-shadow: 0 6px 20px rgba(0, 47, 134, 0.35);
    transition: all 0.22s ease;
    margin-top: 4px;
}

.btn-empty-upload:hover {
    background: linear-gradient(135deg, #0c4ec2 0%, #1562ec 100%);
    box-shadow: 0 8px 24px rgba(12, 78, 194, 0.5);
    transform: translateY(-2px);
}

.btn-empty-upload:active {
    transform: scale(0.98);
}

.empty-hint {
    font-size: 0.76rem;
    color: var(--text-muted);
    font-weight: 600;
}

/* --- CONTROL PANEL SECTION --- */
.controls-section {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    width: 100%;
    min-height: 600px;
}

/* Control Mode Tabs */
.control-tabs {
    display: flex;
    background: #ffffff;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    padding: 4px;
    gap: 4px;
    width: 100%;
    box-shadow: var(--shadow-soft);
}

.tab-item {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-sub);
    font-family: inherit;
    font-size: 0.84rem;
    font-weight: 700;
    padding: 10px 4px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
}

.tab-item.active {
    background: var(--brand-blue);
    color: #ffffff;
}

/* FORMAT SELECTOR CARD */
.format-card {
    background: #ffffff;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    padding: 0.85rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    width: 100%;
    box-shadow: var(--shadow-soft);
    box-sizing: border-box;
}

.format-card-header {
    font-size: 0.78rem;
    font-weight: 800;
    color: var(--brand-blue);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.format-pills {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    background: #f1f5f9;
    padding: 4px;
    border-radius: var(--radius-md);
    border: 1px solid #cbd5e1;
    gap: 4px;
    width: 100%;
    box-sizing: border-box;
}

.format-pill {
    background: transparent;
    border: none;
    color: var(--text-sub);
    padding: 6px 3px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1px;
    min-width: 0;
    box-sizing: border-box;
    overflow: hidden;
}

.format-pill .pill-name {
    font-size: 0.82rem;
    font-weight: 800;
    line-height: 1.2;
}

.format-pill .pill-res {
    font-size: 0.67rem;
    font-weight: 600;
    color: var(--text-muted);
    line-height: 1.2;
}

.format-pill:hover:not(.active) {
    color: var(--brand-blue);
    background: rgba(0, 47, 134, 0.05);
}

.format-pill.active {
    background: var(--brand-blue);
    color: #ffffff;
    box-shadow: 0 2px 8px rgba(0, 47, 134, 0.28);
}

.format-pill.active .pill-name {
    color: #ffffff;
}

.format-pill.active .pill-res {
    color: var(--brand-yellow);
    font-weight: 700;
}

/* ACTIVE FRAME OFFICIAL CARD */
.active-frame-card {
    background: #ffffff;
    border: 1.5px solid var(--border-brand);
    border-radius: var(--radius-md);
    padding: 0.85rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    box-shadow: var(--shadow-soft);
    position: relative;
    overflow: hidden;
}

.active-frame-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    width: 4px;
    background: var(--brand-yellow);
}

.active-frame-thumb {
    width: 58px;
    height: 58px;
    border-radius: var(--radius-sm);
    background: var(--brand-blue);
    border: 1px solid var(--border-light);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    flex-shrink: 0;
}

.active-frame-thumb img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.active-frame-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.active-frame-tag {
    font-size: 0.68rem;
    font-weight: 800;
    color: var(--brand-blue);
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.active-frame-info h4 {
    font-size: 0.92rem;
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1.2;
}

.active-frame-dim {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
}

/* PHOTO CONTROLS CARD */
.photo-controls-card {
    background: #ffffff;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: 1.1rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    width: 100%;
    box-shadow: var(--shadow-soft);
}

/* Frames Gallery Grid */
.frames-carousel {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.65rem;
    width: 100%;
}

.frame-card {
    background: #f8fafc;
    border: 2px solid #e2e8f0;
    border-radius: var(--radius-md);
    overflow: hidden;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    width: 100%;
}

.frame-card:hover {
    border-color: var(--brand-blue);
}

.frame-card.active {
    border-color: var(--brand-yellow);
    box-shadow: 0 0 0 2px rgba(243, 190, 0, 0.4);
}

.frame-card.active::after {
    content: '✓';
    position: absolute;
    top: 4px;
    right: 4px;
    background: var(--brand-green);
    color: #ffffff;
    font-size: 0.68rem;
    font-weight: 900;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 5;
}

.frame-thumb {
    width: 100%;
    aspect-ratio: 1 / 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4px;
    background: #ffffff;
}

.frame-thumb img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: var(--radius-sm);
}

.frame-name {
    font-size: 0.74rem;
    font-weight: 800;
    color: var(--text-sub);
    text-align: center;
    padding: 6px 4px;
    background: #f1f5f9;
    border-top: 1px solid #e2e8f0;
}

/* Tab 2: Photo Controls Grid */
.photo-controls-grid {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    width: 100%;
}

.zoom-box {
    background: #f8fafc;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    padding: 0.85rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.zoom-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.8rem;
    font-weight: 800;
    color: var(--brand-blue);
}

.zoom-badge {
    background: var(--brand-blue);
    color: #ffffff;
    padding: 2px 8px;
    border-radius: var(--radius-pill);
    font-size: 0.72rem;
}

.slider-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-step {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 1px solid #cbd5e1;
    background: #ffffff;
    color: var(--brand-blue);
    font-weight: 900;
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.btn-step:hover {
    background: var(--brand-blue);
    color: #ffffff;
    border-color: var(--brand-blue);
}

input[type="range"] {
    flex: 1;
    accent-color: var(--brand-blue);
    cursor: pointer;
}

/* Quick Tools */
.quick-tools {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
}

.tool-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    background: #f1f5f9;
    border: 1px solid #cbd5e1;
    border-radius: var(--radius-md);
    padding: 8px 10px;
    font-family: inherit;
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.2s ease;
}

.tool-chip:hover {
    background: var(--brand-blue);
    color: #ffffff;
    border-color: var(--brand-blue);
}

.btn-danger-link {
    background: transparent;
    border: none;
    color: #ef4444;
    font-family: inherit;
    font-size: 0.8rem;
    font-weight: 700;
    cursor: pointer;
    text-align: center;
    padding: 4px;
    transition: color 0.2s ease;
}

.btn-danger-link:hover {
    color: #b91c1c;
    text-decoration: underline;
}

/* Single Export Button Container */
.panel-export-box {
    margin-top: auto;
    width: 100%;
}

/* SITE FOOTER (idêntico à página inicial) + MAPA DO SITE */
.site-footer {
    background: #002159;
    color: #9db4c9;
    margin-top: auto;
    padding: 56px 0;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    font-family: 'Gabarito', inherit;
}

.site-footer-wrap {
    width: 100%;
    max-width: 1160px;
    margin: 0 auto;
    padding: 0 24px;
}

.site-footer-grid {
    display: grid;
    grid-template-columns: 1.6fr 1fr 1fr;
    gap: 40px;
    align-items: start;
    margin-bottom: 36px;
}

/* Marca */
.sf-brand {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.sf-logos {
    display: flex;
    align-items: center;
    gap: 26px;
    flex-wrap: wrap;
}

.sf-logo-img {
    height: 96px;
    width: auto;
    max-width: 100%;
    display: block;
}

.sf-seal {
    height: 96px;
    width: auto;
    display: block;
}

.sf-slogan {
    font-family: 'Gabarito', inherit;
    font-size: 16px;
    font-weight: 700;
    color: var(--brand-yellow);
    margin: 16px 0 0;
    max-width: 340px;
}

/* Colunas */
.sf-col { min-width: 0; }

.sf-col-title {
    font-family: 'Gabarito', inherit;
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: #fff;
    margin-bottom: 16px;
}

.sf-nav-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin: 0;
    padding: 0;
}

.sf-nav-list a {
    color: #b9cbdc;
    font-size: 14.5px;
    font-weight: 500;
    text-decoration: none;
    transition: color 0.2s ease, padding-left 0.2s ease;
}

.sf-nav-list a:hover {
    color: var(--brand-yellow);
    padding-left: 4px;
}

/* Redes — botões circulares */
.sf-social {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.sf-social-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.16);
    text-decoration: none;
    transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.sf-social-btn:hover {
    background: var(--brand-yellow);
    border-color: var(--brand-yellow);
    color: var(--brand-blue);
    transform: translateY(-3px);
}

/* Mapa do site */
.sf-sitemap {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 24px;
    margin-bottom: 24px;
}

.sf-sitemap-links {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 22px;
}

.sf-sitemap-links a {
    color: #b9cbdc;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    transition: color 0.2s ease;
}

.sf-sitemap-links a:hover { color: var(--brand-yellow); }

.sf-sitemap-links a[aria-current="page"] {
    color: var(--brand-yellow);
    font-weight: 700;
}

/* Legal */
.sf-legal {
    font-size: 11.5px;
    line-height: 1.7;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 20px;
    color: #7d95ab;
}

.sf-legal p { margin: 0 0 4px; }

.sf-copy { margin-top: 10px; color: #94a3b8; }

/* RESPONSIVE BREAKPOINTS */
@media (max-width: 1100px) {
    .app-main {
        grid-template-columns: 1fr 1fr;
        padding: 1.5rem 1.25rem 2.5rem 1.25rem;
    }
    .desktop-brand-sidebar {
        grid-column: span 2;
    }
}

@media (max-width: 768px) {
    .sidebar-header-outer {
        text-align: center;
        align-items: center;
        background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
        border: 1px solid var(--border-light);
        border-radius: var(--radius-lg);
        padding: 1.35rem 1.15rem;
        box-shadow: var(--shadow-soft);
        gap: 0.75rem;
        width: 100%;
    }
    .hero-badge {
        align-self: center;
        font-size: 0.72rem;
        padding: 4px 12px;
        background: var(--brand-yellow);
        color: var(--brand-blue);
        border-color: var(--brand-yellow);
        box-shadow: var(--shadow-yellow);
    }
    .hero-main-title {
        font-size: 1.75rem;
        line-height: 1.22;
        color: var(--brand-blue);
        letter-spacing: -0.4px;
        margin: 0;
    }
    .hero-subtitle {
        font-size: 1.02rem;
        line-height: 1.62;
        color: #334155;
    }
    .highlight-candidate {
        font-weight: 800;
        background: #fef08a;
        color: var(--brand-blue);
        padding: 2px 8px;
        border-radius: 6px;
        display: inline-block;
        margin: 2px 0;
    }
    .subtitle-break {
        display: block;
        margin-top: 0.5rem;
        color: #475569;
        font-weight: 500;
    }
    .app-main {
        grid-template-columns: 1fr;
        padding: 1rem 1rem 4rem 1rem;
        gap: 1.5rem;
    }
    .desktop-brand-sidebar {
        grid-column: span 1;
    }
    .controls-section {
        min-height: auto;
        gap: 1.25rem;
    }
    .panel-export-box {
        margin-top: 0.5rem;
        margin-bottom: 2rem;
    }
    .format-card {
        padding: 0.75rem;
    }
    .format-pills {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 4px;
        padding: 4px;
        width: 100%;
        box-sizing: border-box;
    }
    .format-pill {
        padding: 6px 2px;
        min-width: 0;
    }
    .format-pill .pill-name {
        font-size: 0.78rem;
    }
    .format-pill .pill-res {
        font-size: 0.64rem;
    }
    .tab-panel {
        min-height: auto;
        height: auto;
        max-height: 480px;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }
    .frames-carousel {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 0.65rem;
        width: 100%;
    }
    .site-footer {
        padding: 44px 0 calc(28px + env(safe-area-inset-bottom, 0px));
    }
    .site-footer-grid {
        grid-template-columns: 1fr;
        gap: 28px;
    }
    .sf-logo-img,
    .sf-seal {
        height: 76px;
    }
}
