body {
    margin: 0;
    font-family: 'Poppins', sans-serif;
    background: #0e0e0e url(img/textura-fundo.png);
    color: #fff;
    position: relative;
    height: 100%;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(ellipse at center, transparent 0%, rgba(0, 0, 0, 0.3) 100%);
    pointer-events: none;
    z-index: -1;
}

.container {
    max-width: 950px;
    margin: auto;
    padding: 20px;
    text-align: center;
    transition: padding 0.3s ease, max-width 0.3s ease;
}

#topo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    margin-bottom: 20px;
    transition: gap 0.3s ease, margin-bottom 0.3s ease;
}

#brasao {
    max-width: 150px;
    width: 100%;
    transition: max-width 0.3s ease, width 0.3s ease;
}

iframe {
    width: 100%;
    display: block;
}

body.ouvidoria-page iframe {
    filter: invert(90%) hue-rotate(180deg) brightness(1.2);
}

h1,
h3 {
    font-size: 2.7em;
    line-height: 1;
    font-family: 'Grenze Gotisch', serif;
    font-weight: 700;
    transition: font-size 0.3s ease;
}

h3 {
    font-size: 1.17em;
    transition: font-size 0.3s ease;
}

h3 span,
h1 span {
    color: #c4161c;
}

.line {
    width: 100%;
    height: 2px;
    background: #c4161c;
    margin: 20px 0 20px;
}

.hero img {
    max-width: 260px;
    width: 100%;
    margin: 0 auto;
    display: block;
}

.line {
    content: '';
    display: block;
    width: 100%;
    height: 2px;
    background: linear-gradient(to right, transparent, rgba(196, 22, 28, 0.9), transparent);
    margin-bottom: 20px;
}

.hero::after {
    content: '';
    display: block;
    width: 100%;
    height: 2px;
    background: linear-gradient(to right, transparent, rgba(255, 255, 255, 0.8), transparent);
    margin-bottom: 20px;
}

.btn span::before {
    content: '';
    display: block;
    width: 100%;
    height: 2px;
    background: linear-gradient(to right, transparent, rgba(196, 22, 28, 0.9), transparent);
    margin-bottom: 10px;
}

/* 🔴 TRÊS COLUNAS FIXAS */
.buttons {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 25px;
    transition: gap 0.3s ease;
}

.btn {
    background-color: rgba(17, 17, 17, 0.2);
    border: 2px solid;
    border-color: #ff4444;
    border-radius: 12px;
    padding: 12px;
    text-decoration: none;
    color: #fff;
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94), padding 0.3s ease;
    position: relative;
    overflow: visible;
    box-shadow: 0 0 0 0 transparent, inset 0 0 0 2px rgba(196, 22, 28, 0.3), inset 0 0 20px rgba(196, 22, 28, 0.2);
}

.btn span {
    display: block;
    font-size: 0.9rem;
    font-weight: bold;
    transition: color 0.4s ease, font-size 0.3s ease;
    position: relative;
    z-index: 1;
}

.btn img {
    width: 150px;
    height: 150px;
    object-fit: contain;
    margin-bottom: 8px;
    position: relative;
    z-index: 1;
    transition: width 0.3s ease, height 0.3s ease, margin-bottom 0.3s ease;
}

.btn:hover {
    transform: scale(1.04) translateY(-8px);
    box-shadow: inset 0 0 300px rgba(196, 22, 28, 0.4), 0 20px 40px rgba(196, 22, 28, 0.5), 0 0 60px rgba(196, 22, 28, 0.3);
    animation: pulse-glow 2s ease-in-out infinite;
    color: #ff6b6b;
}

.btn:hover span {
    color: #ff6b6b;
}

.btn:hover::before {
    opacity: 1;
}

.btn:hover::after {
    z-index: -10;
}

.btn:active {
    background-color: rgba(196, 22, 28, 0.8);
    transform: scale(0.98) translateY(-4px);
}

.btn::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(ellipse at center, rgba(196, 22, 28, 0.2) 0%, transparent 70%);
    border-radius: 12px;
    pointer-events: none;
    z-index: -10;
    transition: opacity 0.4s ease;
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(ellipse at center, rgba(196, 22, 28, 0.3) 0%, transparent 70%);
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.4s ease;
    z-index: -10;
}

@keyframes pulse-glow {

    0%,
    100% {
        box-shadow: inset 0 0 30px rgba(196, 22, 28, 0.6), 0 20px 40px rgba(196, 22, 28, 0.5), 0 0 60px rgba(196, 22, 28, 0.3);
    }

    50% {
        box-shadow: inset 0 0 40px rgba(196, 22, 28, 0.8), 0 25px 50px rgba(196, 22, 28, 0.6), 0 0 80px rgba(196, 22, 28, 0.4);
    }
}

footer {
    margin-top: 20px;
    font-size: 0.9rem;
    color: #aaa;
}

.view-toggle {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 16px 0;
    flex-wrap: wrap;
    color: #eee;
}

.view-toggle span {
    font-weight: 600;
}

.view-toggle .view-btn {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #555;
    border-radius: 8px;
    background: #222;
    color: #bbb;
    cursor: pointer;
    transition: background 0.25s ease, color 0.25s ease, border-color 0.25s ease, transform 0.2s ease;
}

.view-toggle .view-btn:hover {
    background: #333;
    color: #eee;
    transform: translateY(-2px);
}

.view-toggle .view-btn.active {
    background: #444;
    color: #ddd;
    border-color: #666;
}

.anonymous-notice {
    background: rgba(196, 22, 28, 0.15);
    border: 1px solid #c4161c;
    border-radius: 8px;
    padding: 14px 16px;
    margin: 16px 0;
    text-align: center;
}

.anonymous-notice p {
    margin: 0;
    color: #fb8b8b;
    font-weight: 600;
    font-size: 0.95rem;
}

.anonymous-notice strong {
    color: #c4161c;
}


iframe.list-view {
    filter: invert(1) hue-rotate(180deg);
}

/* Ajuste fino para telas muito pequenas */
@media (max-width: 768px) {

    .anonymous-notice {
        margin: 5px;
    }

    .anonymous-notice p {
        font-size: 80%;
    }

    .buttons {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }

    .btn {
        padding: 15px;
    }

    .btn img {
        width: 80px;
        height: 80px;
        object-fit: contain;
    }

    .btn span {
        font-size: 0.9rem;
    }

    h1 {
        font-size: 1.8rem;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 10px;
    }

    .buttons {
        gap: 12px;
    }

    .btn {
        padding: 12px;
        border-width: 1px;
    }

    .btn img {
        width: 60px;
        height: 60px;
        object-fit: contain;
    }

    .btn span {
        font-size: 0.85rem;
    }

    h1 {
        font-size: 1.5rem;
    }



}

@media (max-width: 360px) {
    .btn span {
        font-size: 0.8rem;
    }

    .btn img {
        max-width: 100px;
    }

}

/* ========== PÁGINA DE FORMULÁRIO ========== */

html {
    height: 100%;
}

.form-header {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
    flex-shrink: 0;
    gap: 15px;
    padding: 20px;
    border: 1px solid #343434;
    border-radius: 15px;
    position: relative;
    transition: gap 0.3s ease, padding 0.3s ease, margin-bottom 0.3s ease;
}

.back-btn {
    background-color: rgba(17, 17, 17, 0.2);
    border: 2px solid;
    border-color: #ff4444;
    border-radius: 6px;
    padding: 12px 16px;
    color: #fff;
    cursor: pointer;
    transition: box-shadow 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94), padding 0.3s ease, font-size 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    font-weight: bold;
    font-family: 'Poppins', sans-serif;
    font-size: 0.9rem;
    position: absolute;
    left: 20px;
}

.back-btn:hover {
    box-shadow: inset 0 0 30px rgba(196, 22, 28, 0.4), 0 20px 40px rgba(196, 22, 28, 0.5), 0 0 60px rgba(196, 22, 28, 0.3);
    color: #ff6b6b;
}

.back-btn:active {
    background-color: rgba(196, 22, 28, 0.8);
}

.form-title {
    text-align: left;
    display: flex;
    flex-direction: column;
    justify-content: center;
    flex-shrink: 0;
    transition: gap 0.3s ease;
}

#brasao {
    max-width: 120px;
    width: 100%;
    flex-shrink: 0;
    transition: max-width 0.3s ease, width 0.3s ease;
}

.form-container {
    max-width: 950px;
    margin: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    height: 100%;
    box-sizing: border-box;
    transition: padding 0.3s ease, max-width 0.3s ease;
}

.form-container iframe {
    width: 100%;
    max-width: 100%;
    display: block;
    flex: 1;
    border: none;
    margin: 0 auto;
}

@media (max-width: 768px) {
    .form-header {
        flex-direction: row;
        align-items: center;
        justify-content: flex-start;
        gap: 10px;
        margin-bottom: 20px;
        padding: 15px;
    }

    .back-btn {
        padding: 8px 12px;
        font-size: 0.8rem;
        position: static;
        flex-shrink: 0;
    }

    #brasao {
        max-width: 80px;
        flex-shrink: 0;
    }

    .form-title {
        text-align: left;
        flex: 1;
    }

    .form-title h1 {
        font-size: 1.5rem;
        margin: 0 0 0 0 !important;
    }

    .form-title h3 {
        font-size: 0.9rem;
    }
}

@media (max-width: 480px) {
    .form-header {
        flex-direction: row;
        align-items: center;
        justify-content: flex-start;
        gap: 8px;
        margin-bottom: 20px;
        padding: 12px;
    }

    .back-btn {
        border-width: 1px;
        padding: 6px 10px;
        font-size: 0.75rem;
        gap: 6px;
        flex-shrink: 0;
        position: static;
    }

    #brasao {
        max-width: 60px;
        flex-shrink: 0;
    }

    .form-title {
        flex: 1;
        text-align: left;
    }

    .form-header h1 {
        font-size: 1.1rem;
        margin: 0 !important;
    }

    .form-header h3 {
        font-size: 0.75rem;
    }
}

/* ========== LOGO LINK E LOADING SPINNER ========== */

.logo-link {
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    text-decoration: none;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.logo-link:hover {
    transform: scale(1.05);
    opacity: 0.85;
}

.logo-link:active {
    transform: scale(0.98);
}

.iframe-loader-wrapper {
    position: relative;
    width: 100%;
    display: flex;
    flex: 1;
    flex-direction: column;
    overflow: hidden;
}

.iframe-loader {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: rgba(14, 14, 14, 0.9);
    z-index: 10;
    border-radius: 8px;
    gap: 16px;
}

.spinner {
    width: 48px;
    height: 48px;
    border: 4px solid rgba(196, 22, 28, 0.3);
    border-top-color: #c4161c;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

.iframe-loader p {
    margin: 0;
    color: #888;
    font-size: 0.95rem;
    font-weight: 500;
}

.iframe-loader-wrapper iframe {
    width: 100%;
    height: 100%;
    flex: 1;
    border: none;
}