/* ---------- Design System Tokens ---------- */
:root {
    --bg-dark: #0f172a; /* Slate 900 */
    --panel-bg: rgba(30, 41, 59, 0.7); /* Slate 800 with opacity */
    --panel-border: rgba(148, 163, 184, 0.15); /* Slate 400 */
    
    --primary-gradient: linear-gradient(135deg, #6366f1 0%, #a855f7 100%);
    --primary-shadow: rgba(99, 102, 241, 0.4);
    
    --text-main: #f8fafc; /* Slate 50 */
    --text-muted: #94a3b8; /* Slate 400 */
    
    --input-bg: rgba(15, 23, 42, 0.6);
    --input-border: rgba(148, 163, 184, 0.2);
    --input-focus: #8b5cf6; /* Violet 500 */
    
    --success: #10b981; /* Emerald 500 */
    --error: #ef4444; /* Red 500 */
}

/* ---------- Global Reset & Body ---------- */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Inter', sans-serif;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    min-height: 100vh;
    padding: 3rem 1rem;
    position: relative;
    overflow-x: hidden; /* Mantém as esferas flutuantes sem scroll horizontal */
    overflow-y: auto;   /* Permite rolar para baixo */
}

/* ---------- Background Ambient Glow ---------- */
.background-decorations {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    z-index: 0;
    pointer-events: none;
}
.glow-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(100px);
    opacity: 0.5;
    animation: drift 15s ease-in-out infinite alternate;
}
.orb-1 {
    width: 50vw; height: 50vw;
    background: radial-gradient(circle, #6366f1 0%, transparent 70%);
    top: -10vw; left: -10vw;
}
.orb-2 {
    width: 60vw; height: 60vw;
    background: radial-gradient(circle, #a855f7 0%, transparent 70%);
    bottom: -20vw; right: -10vw;
    animation-delay: -5s;
}
@keyframes drift {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(5%, 5%) scale(1.1); }
}

/* ---------- Premium Glass Panel ---------- */
.glass-panel {
    background: var(--panel-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--panel-border);
    border-radius: 24px;
    padding: 3rem;
    width: 100%;
    max-width: 600px;
    margin: 0 auto; /* Centraliza horizontalmente na tela */
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    z-index: 10;
    animation: fadeInSlide 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes fadeInSlide {
    0% { opacity: 0; transform: translateY(30px); }
    100% { opacity: 1; transform: translateY(0); }
}

/* ---------- Typography & Header ---------- */
.panel-header { margin-bottom: 2rem; text-align: center; }
.title {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -0.5px;
}
.subtitle {
    color: var(--text-muted);
    font-size: 0.95rem;
    line-height: 1.5;
}

/* ---------- Form Elements ---------- */
.form-row {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap; /* Para mobile */
}

.input-group {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 200px; /* Previne colapso em telas menores */
}

label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

input[type="text"], select {
    background: var(--input-bg);
    border: 1px solid var(--input-border);
    border-radius: 12px;
    padding: 0.9rem 1.2rem;
    color: var(--text-main);
    font-size: 1rem;
    transition: all 0.3s ease;
    outline: none;
}
input[type="text"]:focus, select:focus {
    border-color: var(--input-focus);
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.2);
}
input[type="text"]::placeholder { color: rgba(148, 163, 184, 0.4); }

/* Custom Select Dropdown Styling */
.select-wrapper {
    position: relative;
    width: 100%;
}
select {
    width: 100%;
    appearance: none;
    -webkit-appearance: none;
    padding-right: 30px;
}
select option {
    background-color: var(--bg-dark); /* Options fallback dark */
    color: var(--text-main);
}
.dropdown-icon {
    position: absolute;
    right: 1.2rem; top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    font-size: 0.7rem;
    color: var(--text-muted);
}

/* ---------- Drag and Drop Area ---------- */
.file-drop-area {
    position: relative;
    border: 2px dashed var(--input-border);
    border-radius: 16px;
    padding: 3rem 2rem;
    text-align: center;
    background: rgba(15, 23, 42, 0.3);
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    margin-bottom: 2rem;
    overflow: hidden;
    cursor: pointer;
}
.file-drop-area:hover, .file-drop-area.drag-over {
    border-color: var(--input-focus);
    background: rgba(139, 92, 246, 0.05); /* very light purple tint */
}
.file-drop-area.drag-over { transform: scale(1.02); }

.drop-icon {
    color: var(--input-focus);
    margin-bottom: 1rem;
    display: inline-block;
    transition: transform 0.3s ease;
}
.file-drop-area:hover .drop-icon { transform: translateY(-5px); }
.drop-text { color: var(--text-muted); font-size: 0.95rem; }
.drop-text strong { color: var(--text-main); font-weight: 500; }

.file-input {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    opacity: 0;
    cursor: pointer;
}

.file-name-display {
    margin-top: 1rem;
    padding: 0.6rem 1rem;
    background: rgba(148, 163, 184, 0.1);
    border-radius: 8px;
    font-size: 0.85rem;
    color: var(--text-main);
    display: inline-block;
    word-break: break-all;
    border: 1px solid rgba(139, 92, 246, 0.3);
}
.hidden { display: none !important; }

/* ---------- Button ---------- */
.submit-btn {
    width: 100%;
    background: var(--primary-gradient);
    border: none;
    border-radius: 12px;
    padding: 1.1rem;
    color: white;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 10px 20px -10px var(--primary-shadow);
    transition: all 0.3s ease;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    position: relative;
    overflow: hidden;
}
.submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 15px 25px -10px var(--primary-shadow);
}
.submit-btn:active { transform: translateY(1px); }
.submit-btn.loading {
    background: #475569;
    box-shadow: none;
    pointer-events: none;
}

/* Spinner CSS */
.loader {
    width: 20px; height: 20px;
    border: 3px solid rgba(255,255,255,0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s ease-in-out infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Toast Notifications ---------- */
.toast-container {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    z-index: 100;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}
.toast {
    min-width: 300px;
    background: var(--panel-bg);
    backdrop-filter: blur(8px);
    border: 1px solid var(--panel-border);
    padding: 1rem 1.5rem;
    border-radius: 12px;
    color: white;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.3);
    transform: translateX(120%);
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: flex;
    align-items: flex-start;
    gap: 12px;
}
.toast.show { transform: translateX(0); opacity: 1; }
.toast.success { border-left: 4px solid var(--success); }
.toast.error { border-left: 4px solid var(--error); }
.toast-icon { font-size: 1.2rem; line-height: 1; }
.toast-content { flex: 1; }
.toast-title { font-weight: 600; font-size: 0.95rem; margin-bottom: 0.2rem;}
.toast-message { font-size: 0.85rem; color: var(--text-muted); line-height: 1.4; }

/* ---------- Tabela de Confirmação ---------- */
.table-container {
    width: 100%;
    overflow-x: auto;
    background: rgba(15, 23, 42, 0.4);
    border: 1px solid var(--panel-border);
    border-radius: 12px;
    margin-bottom: 1.5rem;
}
.styled-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
    text-align: left;
}
.styled-table th {
    background-color: rgba(99, 102, 241, 0.1);
    color: var(--text-main);
    padding: 12px 15px;
    font-weight: 600;
}
.styled-table td {
    padding: 10px 15px;
    border-top: 1px solid var(--panel-border);
    color: var(--text-main);
}
.table-input {
    background: var(--input-bg);
    border: 1px solid var(--input-border);
    border-radius: 6px;
    padding: 6px 10px;
    color: var(--text-main);
    width: 100%;
    outline: none;
    transition: all 0.2s;
}
.table-input:focus {
    border-color: var(--input-focus);
}

/* ---------- Barra de Progresso ---------- */
.progress-wrapper {
    margin-bottom: 1.5rem;
    text-align: center;
}
.progress-text {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 5px;
}
.progress-bar-container {
    width: 100%;
    height: 8px;
    background: rgba(15, 23, 42, 0.6);
    border-radius: 4px;
    overflow: hidden;
}
.progress-bar {
    height: 100%;
    background: var(--primary-gradient);
    width: 0%;
    transition: width 0.3s ease;
}
