/* ==========================================================================
   STYLE.CSS - PROJECT DRAW (VERSÃO DEFINITIVA - FUNCIONAL E VISUAL FINAL)
   - Layout: Formulário Centralizado + Logo Lateral Absoluta
   - Logo Lateral: GIGANTE (3800px), SÓLIDA e na COR PRATA
   - Tema: Preto Absoluto (Dark) & Branco Puro (Light)
   ========================================================================== */

/* --- IMPORTAÇÃO DE FONTES --- */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap');

/* --- VARIÁVEIS DE TEMA (ROOT - MODO CLARO) --- */
:root {
    /* Cores e Degradês (Prata Titânio) */
    --silver-gradient: linear-gradient(135deg, #57606f 0%, #747d8c 50%, #57606f 100%);
    --silver-text-color: #57606f; /* Cor Prata Base */
    
    /* Cores Institucionais */
    --primary-color: #0d47a1;
    --primary-light: #1565c0;
    --primary-dark: #0a3a8a;
    --secondary-color: #2e7d32;
    --accent-color: #ff6f00;
    
    /* Fundos */
    --bg-color-main: #ffffff; 
    --card-bg: #ffffff;
    --text-color: #333333;
    --text-light: #666666;
    --heading-color: #333333;
    --input-bg: #f8f9fa;
    --input-border: #ced4da;
    --input-focus: #57606f; /* Foco Prata */
    --shadow-color: rgba(0, 0, 0, 0.1);
    --footer-border: rgba(0,0,0,0.1);
    
    /* Imagem de fundo dinâmica */
    --bg-watermark: none;
}

/* --- TEMA ESCURO (PRETO ABSOLUTO) --- */
body.dark-theme {
    /* Prata Brilhante no Escuro */
    --silver-gradient: linear-gradient(135deg, #bdc3c7 0%, #ffffff 50%, #bdc3c7 100%);
    --silver-text-color: #e0e0e0; /* Prata mais claro */

    --primary-color: #bdc3c7;
    --primary-light: #ffffff;
    --secondary-color: #4caf50;
    
    /* Fundo Preto Absoluto */
    --bg-color-main: #000000;
    
    --card-bg: #121212;
    --text-color: #e0e0e0;
    --text-light: #b0b0b0;
    --heading-color: #ffffff;
    --input-bg: #1e1e1e;
    --input-border: #444;
    --input-focus: #ffffff;
    --shadow-color: rgba(255, 255, 255, 0.05);
    --footer-border: rgba(255,255,255,0.1);
}

/* ==========================================================================
   ESTRUTURA GERAL
   ========================================================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Poppins', 'Segoe UI', Roboto, sans-serif;
    color: var(--text-color);
    line-height: 1.6;
    min-height: 100vh;
    background-color: var(--bg-color-main);
    transition: background-color 0.5s ease, color 0.3s ease;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
}

/* Marca D'água Central */
body::before {
    content: "";
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80%;
    height: 80%;
    background-image: var(--bg-watermark);
    background-position: center;
    background-repeat: no-repeat;
    background-size: contain;
    opacity: 0.03;
    z-index: -1;
    pointer-events: none;
    transition: background-image 0.5s ease;
    mix-blend-mode: overlay;
}

/* ==========================================================================
   CABEÇALHO (HEADER)
   ========================================================================== */
.site-header {
    width: 100%;
    padding: 20px 0;
    position: relative;
    z-index: 100;
    border-bottom: 1px solid var(--footer-border);
}

.header-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-title-container {
    display: flex;
    flex-direction: column;
}

/* Título Principal */
.header-title {
    font-size: 2.2rem;
    font-weight: 700;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 15px;
    
    background: var(--silver-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    color: var(--silver-text-color);
    
    filter: drop-shadow(0px 2px 2px rgba(0,0,0,0.1));
}

.header-title i {
    background: var(--silver-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.header-subtitle {
    font-size: 1rem;
    color: var(--text-light);
    margin-top: 5px;
    letter-spacing: 1px;
}

.top-controls {
    display: flex;
    align-items: center;
    gap: 20px;
}

/* Botão de Tema */
.theme-btn {
    background: transparent; 
    border: 1px solid var(--input-border);
    width: 35px;
    height: 35px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.theme-btn i { color: #000000; }
body.dark-theme .theme-btn i { color: #ffffff; }

.theme-btn:hover {
    background: rgba(128, 128, 128, 0.1);
    transform: rotate(15deg);
}

.header-logo {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--card-bg);
    background: var(--card-bg);
    box-shadow: 0 6px 20px rgba(0,0,0,0.15);
    transition: all 0.3s ease;
}

.header-logo:hover {
    transform: scale(1.1) rotate(10deg);
}

/* ==========================================================================
   LAYOUT PRINCIPAL: CENTRALIZAÇÃO
   ========================================================================== */
.main-content {
    width: 100%;
    max-width: 100%; 
    padding: 40px 20px;
    position: relative;
    z-index: 10;
    flex: 1;
    display: flex;
    justify-content: center;
}

/* O CONTAINER DO CARTÃO */
.card-container {
    position: relative;
    width: 100%;
    max-width: 750px;
    margin: 0 auto;
    animation: slideUp 0.8s ease-out;
    display: block;
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}

/* --- LOGO LATERAL (POSICIONADA ABSOLUTAMENTE) --- */
.vertical-logo-wrapper {
    position: absolute;
    right: 100%;
    top: 50px;
    margin-right: 60px;
    
    width: 200px; 
    height: auto;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    z-index: 10;
}

.vertical-logo {
    transform: rotate(-90deg);
    width: 3800px; 
    height: auto;
    max-width: none;
    
    /* Logo Sólida */
    opacity: 1;
    
    /* FILTRO DE COR PRATA (Modo Claro - #57606f) */
    filter: brightness(0) invert(39%) sepia(10%) saturate(1085%) hue-rotate(183deg) brightness(93%) contrast(87%) drop-shadow(5px -5px 10px rgba(0,0,0,0.1));
    
    transition: filter 0.3s ease;
    transform-origin: center center;
}

/* Modo Escuro: Filtro para Prata Mais Claro (#e0e0e0) */
body.dark-theme .vertical-logo {
    filter: brightness(0) invert(94%) sepia(0%) saturate(31%) hue-rotate(177deg) brightness(103%) contrast(86%) drop-shadow(0 0 15px rgba(255,255,255,0.1));
}

/* --- CARTÃO DO FORMULÁRIO --- */
.card {
    background: var(--card-bg); 
    width: 100%;
    border-radius: 24px;
    overflow: hidden;
    box-shadow: 0 25px 60px rgba(0,0,0,0.15);
    transition: transform 0.3s;
    border: 1px solid var(--footer-border);
    position: relative;
    z-index: 5;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 30px 70px rgba(0,0,0,0.2);
}

.card-header {
    background: transparent;
    padding: 30px;
    text-align: center;
    border-bottom: 1px solid rgba(0,0,0,0.1);
}

.card-header h2 { 
    font-size: 1.8rem;
    margin-bottom: 10px;
    font-weight: 700;
    background: var(--silver-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    color: var(--silver-text-color);
}

.card-header i { 
    background: var(--silver-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    color: var(--silver-text-color);
}

.card-subtitle {
    font-size: 1rem;
    opacity: 0.8;
    font-weight: 500;
    color: var(--text-light);
}

/* ==========================================================================
   INPUTS & ELEMENTOS
   ========================================================================== */
#inputArea { padding: 30px; }

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 25px;
}

.input-group { margin-bottom: 0; }
.input-group.full-width { grid-column: 1 / -1; }

label {
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
    color: var(--text-color);
    font-size: 1rem;
}

.required-mark { color: var(--error-color); margin-left: 5px; }
.optional-mark { color: var(--text-light); font-weight: 400; font-size: 0.9em; margin-left: 5px; }

input[type="text"], textarea {
    width: 100%;
    padding: 16px 20px;
    border: 2px solid var(--input-border);
    border-radius: 12px;
    font-size: 1rem;
    background: var(--input-bg);
    color: var(--text-color);
    transition: all 0.3s;
}

input[type="text"]:focus, textarea:focus {
    outline: none;
    border-color: var(--input-focus);
    box-shadow: 0 0 0 3px rgba(87, 96, 111, 0.2);
}

textarea {
    min-height: 120px;
    resize: vertical;
}

/* Radio Buttons */
.radio-group {
    background: var(--input-bg);
    padding: 20px;
    border-radius: 12px;
    border: 2px solid var(--input-border);
}

.radio-option {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
    cursor: pointer;
    position: relative;
}

.radio-option:hover {
    background: rgba(189, 195, 199, 0.1);
}

.radio-option:last-child { margin-bottom: 0; }
.radio-option input { display: none; }

.radio-content {
    display: flex;
    align-items: center;
    gap: 15px;
    width: 100%;
    padding: 10px 12px;
    border-radius: 8px;
    transition: all 0.3s;
}

.radio-content i { font-size: 1.5rem; color: var(--text-light); }
.radio-content span { font-size: 1rem; font-weight: 500; color: var(--text-color); }

.radio-option input:checked + .radio-content {
    background: linear-gradient(135deg, rgba(87, 96, 111, 0.1), rgba(87, 96, 111, 0.05));
    border: 2px solid var(--silver-text-color);
    margin: -2px;
    transform: scale(1.02);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.radio-option input:checked + .radio-content i,
.radio-option input:checked + .radio-content span {
    color: var(--silver-text-color);
}

body.dark-theme .radio-option input:checked + .radio-content {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.02));
    border-color: #ffffff;
}

body.dark-theme .radio-option input:checked + .radio-content i,
body.dark-theme .radio-option input:checked + .radio-content span {
    color: #ffffff;
}

/* Upload */
.file-upload-wrapper {
    border: 3px dashed var(--input-border);
    border-radius: 16px;
    padding: 40px;
    text-align: center;
    cursor: pointer;
    background: var(--input-bg);
    position: relative;
    transition: all 0.3s;
}

.file-upload-wrapper:hover {
    border-color: var(--primary-color);
    background: rgba(189, 195, 199, 0.1);
}

input[type="file"] {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

.upload-area i {
    font-size: 4rem;
    margin-bottom: 20px;
    background: var(--silver-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    color: var(--silver-text-color);
}

.upload-text { font-size: 1.2rem; font-weight: 600; color: var(--text-color); }
.file-info { margin-top: 15px; text-align: center; }
.file-info small { color: var(--text-light); }

/* Botões */
.btn-container {
    display: flex;
    gap: 20px;
    margin-top: 40px;
    padding: 0 30px 30px;
}

button {
    flex: 1;
    padding: 18px 30px;
    border: none;
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
    font-size: 1.1rem;
    letter-spacing: 1px;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    text-transform: uppercase;
}

button:active { transform: scale(0.98); }

.btn-primary { 
    background: var(--silver-gradient); 
    color: white; 
    box-shadow: 0 6px 20px rgba(0,0,0,0.15); 
}

body.dark-theme .btn-primary { color: #000; }

.btn-primary:hover {
    filter: brightness(1.1);
    transform: translateY(-3px);
}

.btn-secondary { background: #d32f2f; color: white; }
.btn-new { background: var(--secondary-color); color: white; width: 100%; margin-top: 20px; }

/* Status */
#statusArea {
    display: none;
    padding: 30px;
    background: var(--input-bg);
    margin: 0 30px 30px;
    border-radius: 16px;
    border: 2px solid var(--input-border);
}

.progress-bg {
    width: 100%;
    background: #bdc3c7;
    height: 35px;
    border-radius: 18px;
    overflow: hidden;
    margin-bottom: 15px;
    position: relative;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #2e7d32, #66bb6a);
    width: 0%;
    transition: width 0.5s;
}

.progress-text {
    position: absolute;
    width: 100%;
    text-align: center;
    top: 50%;
    transform: translateY(-50%);
    color: white;
    font-weight: 700;
    text-shadow: 1px 1px 3px rgba(0,0,0,0.3);
}

#warningBox {
    display: none;
    background: linear-gradient(135deg, #f39c12, #e67e22);
    color: white;
    padding: 20px;
    margin: 20px;
    border-radius: 12px;
    align-items: center;
    gap: 15px;
}

#successMessage, #finalReport {
    display: none;
    text-align: center;
    padding: 50px 30px;
}

.success-icon { font-size: 6rem; color: var(--success-color); margin-bottom: 25px; }
.success-title { font-size: 2.2rem; color: var(--heading-color); }

/* ==========================================================================
   RODAPÉ (FOOTER)
   ========================================================================== */
.site-footer {
    margin-top: 20px;
    padding: 10px 20px;
    color: var(--text-light);
    font-size: 0.85rem;
    border-top: 1px solid var(--footer-border);
    background: transparent;
}

.footer-content {
    max-width: 1100px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
}

.footer-client { text-align: left; flex: 1; }
.footer-client p { font-weight: 600; margin-bottom: 2px; color: var(--text-color); }
.footer-contact { display: flex; flex-direction: column; gap: 2px; }
.footer-contact span { display: flex; align-items: center; gap: 6px; }
.footer-contact i { color: var(--silver-text-color); font-size: 0.9em; }

.footer-dev {
    text-align: right;
    flex: 1;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    opacity: 0.9;
}

.dev-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-light);
    margin: 0;
    white-space: nowrap;
}

.dev-container {
    display: flex;
    align-items: center;
    gap: 10px;
    transition: transform 0.3s ease;
}

.dev-container:hover { transform: translateY(-2px); }

/* LOGO DESENVOLVEDOR (PRETO/BRANCO) */
.dev-logo {
    height: 75px; 
    width: auto;
    /* Modo Claro: Preto */
    filter: brightness(0) drop-shadow(0 2px 3px rgba(0,0,0,0.2)); 
    transition: filter 0.3s ease;
}

/* Modo Escuro: Branco */
body.dark-theme .dev-logo {
    filter: brightness(0) invert(1) drop-shadow(0 2px 3px rgba(255,255,255,0.2));
}

.dev-info {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    font-size: 0.75rem;
    line-height: 1.2;
}

.dev-name { font-weight: 700; color: var(--silver-text-color); }
.dev-contact { color: var(--text-light); display: flex; gap: 8px; }

/* LOADING */
#loadingOverlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.9);
    z-index: 9999;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    color: white;
    backdrop-filter: blur(10px);
}

.spinner {
    border: 8px solid rgba(255,255,255,0.1);
    border-top: 8px solid #57606f;
    border-radius: 50%;
    width: 80px;
    height: 80px;
    animation: spin 1.5s infinite;
    margin-bottom: 30px;
}

body.dark-theme .spinner { border-top: 8px solid #bdc3c7; }

@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }

.loading-dots { display: inline-block; width: 20px; text-align: left; }
.loading-dots::after { content: ''; animation: dots 1.5s steps(4, end) infinite; }
@keyframes dots { 0%, 20% { content: ''; } 40% { content: '.'; } 60% { content: '..'; } 80%, 100% { content: '...'; } }
#loadingText { font-size: 1.3rem; display: flex; align-items: center; gap: 5px; }

/* RESPONSIVIDADE */
@media (max-width: 1400px) {
    /* Esconde a logo lateral para não quebrar o layout */
    .vertical-logo-wrapper { display: none; }
}

@media (max-width: 768px) {
    .form-grid { grid-template-columns: 1fr; gap: 20px; }
    
    .header-content { flex-direction: column; text-align: center; gap: 20px; }
    
    .btn-container { flex-direction: column; }
    
    .footer-content { flex-direction: column; text-align: center; gap: 20px; }
    .footer-client, .footer-dev { text-align: center; align-items: center; }
    .footer-contact { align-items: center; }
    .footer-dev { flex-direction: column; justify-content: center; }
    .dev-container { flex-direction: column; gap: 5px; }
    .dev-info { align-items: center; }
}