/* ==========================================
   RESET E ESTILOS GLOBAIS
   ========================================== */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

:root {
    --bg: #f3f6fb;
    --surface: #ffffff;
    --surface-secondary: #eef3f8;
    --primary: #0d47a1;
    --primary-dark: #0b3a85;
    --secondary: #546e7a;
    --border: #d7e0ec;
    --text: #24334d;
    --muted: #657786;
    --danger: #d32f2f;
    --navy: #0f2340;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: var(--text);
    background: linear-gradient(180deg, var(--navy) 0%, #0d2a55 100%);
    min-height: 100vh;
}

/* ==========================================
   CONTAINER
   ========================================== */

.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 18px 24px;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* ==========================================
   HEADER
   ========================================== */

.header {
    background: transparent;
    color: var(--text);
    padding: 8px 0;
    border-bottom: none;
    box-shadow: none;
    margin-bottom: 0;
}

.brand-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px 0;
    background: transparent;
}

.brand-logo {
    width: 110px;
    height: auto;
    max-width: 100%;
    display: block;
}

.header-content {
    animation: fadeInDown 0.6s ease-out;
    text-align: center;
    min-width: 260px;
}

.brand-title {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 4px;
    letter-spacing: 0.5px;
}

.brand-subtitle {
    font-size: 1rem;
    font-weight: 400;
    color: var(--muted);
    margin: 0;
}

/* ==========================================
   MAIN CONTENT
   ========================================== */

.main-content {
    flex: 1;
    margin-bottom: 30px;
}

.hero {
    text-align: center;
    color: #ffffff;
    padding: 24px 18px 16px;
}

.hero h1 {
    font-size: 34px;
    line-height: 1.1;
    font-weight: 800;
    color: #ffffff;
    margin: 0 auto 16px;
    max-width: 720px;
    display: inline-flex;
    flex-direction: column;
    gap: 4px;
}

.hero h1 span {
    display: block;
}

@media (max-width: 900px) {
    .brand-title { font-size: 1.4rem; }
    .hero h1 { font-size: 38px; }
}

@media (max-width: 480px) {
    .brand-bar { padding: 10px; }
    .brand-left, .brand-right { flex: 0 0 56px; }
    .hero h1 { font-size: 26px; }
}

.form-section {
    width: 100%;
}

.form-container {
    background: #ffffff;
    border-radius: 16px;
    border: 1px solid rgba(13,34,64,0.06);
    box-shadow: 0 18px 40px rgba(2,6,23,0.18);
    padding: 28px 24px;
    animation: fadeInUp 0.45s ease-out;
    max-width: 760px;
    width: 100%;
    margin: 0 auto 38px;
}

.form-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 20px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.form-header .tag {
    display: inline-block;
    margin-bottom: 10px;
    padding: 8px 16px;
    font-size: 0.85rem;
    font-weight: 700;
    color: #ffffff;
    background: #0b3b82;
    border-radius: 999px;
    letter-spacing: 0.5px;
}

.form-note {
    max-width: 360px;
    font-size: 0.95rem;
    color: var(--secondary);
    line-height: 1.5;
}

.form-status {
    padding: 16px 20px;
    margin-bottom: 20px;
    border-radius: 12px;
    background: #eef4ff;
    border: 1px solid #c8d7f5;
    color: #1f3d70;
    display: none;
}

.form-status.active {
    display: block;
}

.field-error {
    border-color: #d32f2f !important;
}

.field-error-message {
    color: #d32f2f;
    margin-top: 8px;
    font-size: 0.88rem;
}

.form-container h2 {
    color: #0b3b82;
    font-size: 1.7rem;
    font-weight: 800;
    margin: 0 0 8px;
    text-align: left;
    letter-spacing: -0.5px;
}

.form-description {
    text-align: left;
    color: #586b84;
    margin: 0 0 22px;
    font-size: 0.96rem;
    line-height: 1.6;
}

/* ==========================================
   FORMULÁRIO
   ========================================== */

.form {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.form-fieldset {
    border: 1px solid rgba(13,34,64,0.10);
    border-radius: 18px;
    padding: 22px 22px 18px;
    margin: 0 0 18px 0;
    background: #f7f9fc;
    box-shadow: inset 0 0 0 1px rgba(255,255,255,0.6);
}

.form-fieldset legend {
    display: inline-flex;
    align-items: center;
    font-size: 0.95rem;
    font-weight: 700;
    color: #ffffff;
    margin: 0 0 16px;
    padding: 8px 14px;
    background: #0b2340;
    border-radius: 999px;
    letter-spacing: 0.3px;
}

.form-group {
    display: flex;
    flex-direction: column;
    margin-bottom: 12px;
}

.form-group:last-child {
    margin-bottom: 0;
}

.form-group label {
    font-weight: 700;
    margin-bottom: 10px;
    color: #1f3347;
    font-size: 0.92rem;
}

.required {
    color: var(--danger);
    font-weight: bold;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 14px 16px;
    border: 1px solid #d8e2ef;
    border-radius: 12px;
    font-size: 1rem;
    font-family: inherit;
    transition: all 0.25s ease;
    background: #f7f9fc;
    color: #172b4d;
    box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.08);
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: rgba(13, 71, 161, 0.95);
    box-shadow: 0 0 0 3px rgba(13, 71, 161, 0.12);
    background: #ffffff;
}

.form-group input:invalid:not(:placeholder-shown),
.form-group select:invalid:not(:placeholder-shown) {
    border-color: var(--danger);
}

.form-group input::placeholder {
    color: #9ba2b3;
}

/* ==========================================
   GRID RESPONSIVO
   ========================================== */

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 18px;
    align-items: start;
}

/* ==========================================
   INPUT FILE CUSTOMIZADO
   ========================================== */

.file-input-wrapper {
    position: relative;
    display: inline-block;
    width: 100%;
}

#anexos {
    display: none;
}

.file-input-label {
    display: block;
    padding: 10px 12px;
    border: 1px dashed #d0d5dd;
    border-radius: 6px;
    background: #fafafa;
    color: var(--text);
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
}

.file-input-wrapper:hover .file-input-label {
    background: #edf4ff;
    border-color: var(--primary-dark);
    color: var(--primary-dark);
}

.file-input-wrapper.has-files .file-input-label {
    border-style: solid;
    background: #e6f2ff;
    color: #1d6bc4;
}

.form-hint {
    display: block;
    margin-top: 10px;
    font-size: 0.88rem;
    color: var(--secondary);
}

.upload-status-message {
    display: block;
    margin-top: 10px;
    font-size: 0.9rem;
    font-weight: 700;
}

#uploaded-files-list ul {
    list-style-type: none;
    padding: 0;
    margin-top: 12px;
}

#uploaded-files-list li {
    background-color: #edf4ff;
    border: 1px solid #c8d7f5;
    border-radius: 8px;
    padding: 10px 14px;
    margin-bottom: 6px;
    font-size: 0.92rem;
    color: #1f3d70;
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
}

#uploaded-files-list li::before {
    content: '✔';
    color: #2e7d32;
    font-weight: bold;
}

/* ==========================================
   BOTÕES
   ========================================== */

.form-actions {
    display: flex;
    gap: 16px;
    margin-top: 24px;
    justify-content: space-between;
    flex-wrap: wrap;
}

@media (max-width: 720px) {
    .form-actions {
        justify-content: center;
    }

    .btn-primary,
    .btn-secondary {
        width: 100%;
        max-width: 100%;
    }
}

.btn {
    padding: 15px 44px;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.25s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn-primary {
    background: #0b2340;
    color: white;
    box-shadow: 0 8px 18px rgba(2,6,23,0.35);
    padding: 14px 34px;
    border-radius: 40px;
    font-size: 1.05rem;
    width: auto;
    display: inline-block;
    text-align: center;
    min-width: 180px;
}

.btn-secondary {
    min-width: 180px;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 14px 28px rgba(2,6,23,0.48);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-secondary {
    background: #ffffff;
    color: var(--text);
    border: 1px solid #e6e9ee;
    box-shadow: none;
}

.btn-secondary:hover {
    background: #e5edf8;
    transform: translateY(-2px);
}

.btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

/* ==========================================
   AVISO DE PRIVACIDADE
   ========================================== */

.privacy-notice {
    background: transparent;
    border-left: none;
    padding: 8px 0 0;
    border-radius: 0;
    margin-top: 18px;
    text-align: center;
}

.privacy-notice p {
    color: #1f354f;
    font-size: 0.96rem;
    margin: 0;
}

/* ==========================================
   MENSAGEM DE SUCESSO
   ========================================== */

.success-message {
    background: #e7f1ff;
    border: 1px solid #a9c7ee;
    border-radius: 8px;
    padding: 18px;
    text-align: center;
    color: #0c2f5d;
    animation: slideIn 0.5s ease-out;
}

.success-message h3 {
    font-size: 1.6rem;
    margin-bottom: 10px;
}

.success-message p {
    margin: 0;
}

/* ==========================================
   FOOTER
   ========================================== */

.footer {
    background: transparent;
    color: #ffffffa8;
    text-align: center;
    padding: 28px 0 40px;
    margin-top: auto;
    font-size: 0.95rem;
}

/* ==========================================
   ANIMAÇÕES
   ========================================== */

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* ==========================================
   RESPONSIVIDADE
   ========================================== */

@media (max-width: 768px) {
    .header {
        padding: 30px 15px;
        margin-bottom: 20px;
    }

    .brand-title {
        font-size: 1.9rem;
    }

    .brand-subtitle {
        font-size: 1rem;
    }

    .form-container {
        padding: 30px 18px;
    }

    .form-container h2 {
        font-size: 1.65rem;
    }

    .form-fieldset {
        padding: 18px;
    }

    .form-actions {
        flex-direction: column;
    }

    .btn {
        width: 100%;
    }

    .form-row {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 10px;
    }

    .header {
        padding: 20px 10px;
        margin-bottom: 15px;
    }

    .logo {
        font-size: 1.5rem;
    }

    .subtitle {
        font-size: 0.9rem;
    }

    .form-container {
        padding: 15px 10px;
        border-radius: 0;
    }

    .form-container h2 {
        font-size: 1.2rem;
    }

    .form-group {
        margin-bottom: 12px;
    }

    .form-fieldset {
        padding: 12px;
        margin-bottom: 15px;
    }

    .form-fieldset legend {
        font-size: 1rem;
    }

    .btn {
        padding: 12px 20px;
        font-size: 0.9rem;
    }

    .privacy-notice {
        font-size: 0.9rem;
    }
}

/* ==========================================
   MODAL DE STATUS DE ENVIO
   ========================================== */

.submit-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(2, 6, 23, 0.7);
    backdrop-filter: blur(4px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    animation: fadeIn 0.3s forwards;
}

.submit-modal {
    background: #ffffff;
    border-radius: 20px;
    padding: 40px 30px;
    width: 90%;
    max-width: 420px;
    text-align: center;
    box-shadow: 0 20px 50px rgba(0,0,0,0.3);
    transform: translateY(20px);
    animation: slideUpModal 0.4s forwards cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.submit-spinner {
    width: 60px;
    height: 60px;
    border: 5px solid #eef3f8;
    border-top: 5px solid #0d47a1;
    border-radius: 50%;
    margin: 0 auto 20px;
    animation: spin 1s linear infinite;
}

.submit-icon-success, .submit-icon-error {
    font-size: 50px;
    margin-bottom: 20px;
    display: inline-block;
}

.submit-icon-success {
    color: #2e7d32;
}

.submit-icon-error {
    color: #d32f2f;
}

.submit-modal h3 {
    font-size: 1.4rem;
    color: #102c52;
    margin-bottom: 12px;
}

.submit-modal p {
    font-size: 1rem;
    color: #586b84;
    margin-bottom: 0;
}

@keyframes fadeIn {
    to { opacity: 1; }
}

@keyframes slideUpModal {
    to { transform: translateY(0); }
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}
