/**
 * SCORING - Estilos
 * Identidade Visual:
 * - #18B8A8 (principal - verde água)
 * - #F07820 (CTA - laranja)
 * - #F8A018 (secundária - amarelo)
 * - #186868 (escura)
 * - #383838 (texto)
 */

 /* ============================================
    RESET & BASE
 ============================================ */
 * {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --color-primary: #18B8A8;
    --color-cta: #F07820;
    --color-secondary: #F8A018;
    --color-dark: #186868;
    --color-text: #383838;
    --color-bg: #f5f5f5;
    --color-white: #ffffff;
    --color-error: #dc3545;
    --color-danger: #dc3545;
    --color-success: #28a745;
    --color-warning: #ffc107;
    --color-border: #ddd;

    --font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    --font-mono: 'Courier New', Courier, monospace;

    --shadow-sm: 0 1px 3px rgba(0,0,0,0.12);
    --shadow-md: 0 4px 6px rgba(0,0,0,0.1);
    --shadow-lg: 0 10px 20px rgba(0,0,0,0.15);

    --radius: 8px;
    --radius-sm: 4px;
}

body {
    font-family: var(--font-family);
    color: var(--color-text);
    background-color: var(--color-bg);
    line-height: 1.6;
    font-size: 16px;
}

/* ============================================
   TYPOGRAPHY
============================================ */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: 1.2;
    margin-bottom: 1rem;
    color: var(--color-dark);
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.25rem; }
h5 { font-size: 1.1rem; }
h6 { font-size: 1rem; }

p {
    margin-bottom: 1rem;
}

a {
    color: var(--color-primary);
    text-decoration: none;
    transition: color 0.2s;
}

a:hover {
    color: var(--color-dark);
}

/* ============================================
   LAYOUT
============================================ */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.container-narrow {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ============================================
   HEADER / NAVBAR
============================================ */
.navbar {
    background: var(--color-white);
    box-shadow: var(--shadow-sm);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

.navbar-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.navbar-brand {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--color-primary);
    text-decoration: none;
}

.navbar-brand:hover {
    color: var(--color-dark);
}

.navbar-menu {
    display: flex;
    gap: 1.5rem;
    align-items: center;
    list-style: none;
}

.navbar-menu a {
    color: var(--color-text);
    font-weight: 500;
    transition: color 0.2s;
}

.navbar-menu a:hover {
    color: var(--color-primary);
}

.navbar-user {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.navbar-user span {
    font-weight: 500;
    color: var(--color-dark);
}

/* ============================================
   BUTTONS
============================================ */
.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: var(--radius);
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    text-align: center;
    transition: all 0.2s;
    text-decoration: none;
    line-height: 1;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-primary {
    background: var(--color-primary);
    color: var(--color-white);
}

.btn-primary:hover:not(:disabled) {
    background: var(--color-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-cta {
    background: var(--color-cta);
    color: var(--color-white);
}

.btn-cta:hover:not(:disabled) {
    background: #d6651a;
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-secondary {
    background: var(--color-secondary);
    color: var(--color-white);
}

.btn-secondary:hover:not(:disabled) {
    background: #e08a00;
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--color-primary);
    color: var(--color-primary);
}

.btn-outline:hover:not(:disabled) {
    background: var(--color-primary);
    color: var(--color-white);
}

.btn-danger {
    background: var(--color-error);
    color: var(--color-white);
}

.btn-danger:hover:not(:disabled) {
    background: #c82333;
}

.btn-warning {
    background: var(--color-warning);
    color: var(--color-text);
}

.btn-warning:hover:not(:disabled) {
    background: #e0a800;
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

.btn-lg {
    padding: 1rem 2rem;
    font-size: 1.125rem;
}

/* ============================================
   FORMS
============================================ */
.form-group {
    margin-bottom: 1.5rem;
}

label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--color-dark);
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
textarea,
select {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    font-size: 1rem;
    font-family: var(--font-family);
    transition: border-color 0.2s;
}

input:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(24, 184, 168, 0.1);
}

textarea {
    resize: vertical;
    min-height: 100px;
}

.input-error {
    border-color: var(--color-error) !important;
}

.error-message {
    color: var(--color-error);
    font-size: 0.875rem;
    margin-top: 0.5rem;
}

.success-message {
    color: var(--color-success);
    font-size: 0.875rem;
    margin-top: 0.5rem;
}

/* ============================================
   CARDS
============================================ */
.card {
    background: var(--color-white);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.card-header {
    border-bottom: 1px solid var(--color-border);
    padding-bottom: 1rem;
    margin-bottom: 1rem;
}

.card-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin: 0;
}

.card-body {
    padding: 0;
}

.card-footer {
    border-top: 1px solid var(--color-border);
    padding-top: 1rem;
    margin-top: 1rem;
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
}

/* ============================================
   TABLES
============================================ */
.table-wrapper {
    overflow-x: auto;
    margin-bottom: 1.5rem;
}

table {
    width: 100%;
    border-collapse: collapse;
    background: var(--color-white);
}

thead {
    background: var(--color-bg);
}

th {
    padding: 1rem;
    text-align: left;
    font-weight: 600;
    color: var(--color-dark);
    border-bottom: 2px solid var(--color-border);
}

td {
    padding: 1rem;
    border-bottom: 1px solid var(--color-border);
}

tr:hover {
    background: rgba(24, 184, 168, 0.05);
}

/* ============================================
   STATUS BADGES
============================================ */
.status-badge {
    display: inline-block;
    padding: 0.375rem 0.75rem;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 500;
    line-height: 1;
}

.status-submitted {
    background: #e3f2fd;
    color: #1976d2;
}

.status-validated {
    background: #e8f5e9;
    color: #388e3c;
}

.status-running {
    background: #fff3e0;
    color: #f57c00;
}

.status-success {
    background: #e8f5e9;
    color: #2e7d32;
}

.status-error {
    background: #ffebee;
    color: #c62828;
}

.status-timeout {
    background: #fce4ec;
    color: #c2185b;
}

/* ============================================
   PROGRESS BAR
============================================ */
.progress {
    height: 24px;
    background: var(--color-bg);
    border-radius: var(--radius);
    overflow: hidden;
    position: relative;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--color-primary), var(--color-secondary));
    transition: width 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-white);
    font-weight: 500;
    font-size: 0.875rem;
}

/* ============================================
   ALERTS
============================================ */
.alert {
    padding: 1rem;
    border-radius: var(--radius);
    margin-bottom: 1.5rem;
    border-left: 4px solid;
}

.alert-info {
    background: #e3f2fd;
    border-color: #1976d2;
    color: #0d47a1;
}

.alert-success {
    background: #e8f5e9;
    border-color: #388e3c;
    color: #1b5e20;
}

.alert-warning {
    background: #fff3e0;
    border-color: #f57c00;
    color: #e65100;
}

.alert-danger {
    background: #ffebee;
    border-color: #c62828;
    color: #b71c1c;
}

/* ============================================
   LOGIN PAGE
============================================ */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.login-card {
    width: 100%;
    max-width: 400px;
    background: var(--color-white);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    padding: 2.5rem;
}

.login-logo {
    text-align: center;
    margin-bottom: 2rem;
}

.login-logo h1 {
    color: var(--color-primary);
    font-size: 2rem;
    margin: 0;
}

.login-logo p {
    color: var(--color-text);
    margin: 0.5rem 0 0 0;
}

/* ============================================
   JOB DETAIL PAGE
============================================ */
.job-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 2rem;
}

.job-info p {
    margin: 0.5rem 0;
    color: var(--color-text);
}

.job-info strong {
    color: var(--color-dark);
}

.job-actions {
    display: flex;
    gap: 1rem;
}

.job-progress {
    margin: 2rem 0;
}

.job-progress-stage {
    text-align: center;
    margin-top: 0.5rem;
    color: var(--color-text);
    font-size: 0.875rem;
}

/* ============================================
   FILE UPLOAD
============================================ */
.file-upload {
    border: 2px dashed var(--color-border);
    border-radius: var(--radius);
    padding: 2rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
}

.file-upload:hover {
    border-color: var(--color-primary);
    background: rgba(24, 184, 168, 0.05);
}

.file-upload.drag-over {
    border-color: var(--color-primary);
    background: rgba(24, 184, 168, 0.1);
}

.file-upload-icon {
    font-size: 3rem;
    color: var(--color-primary);
    margin-bottom: 1rem;
}

.file-upload input[type="file"] {
    display: none;
}

/* ============================================
   UTILITIES
============================================ */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-left { text-align: left; }

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }

.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }

.flex { display: flex; }
.flex-column { flex-direction: column; }
.flex-center { align-items: center; justify-content: center; }
.flex-between { justify-content: space-between; }
.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }
.gap-3 { gap: 1.5rem; }

.hidden { display: none; }

/* ============================================
   BADGES
============================================ */
.badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    font-size: 0.875rem;
    font-weight: 500;
    border-radius: var(--radius-sm);
    text-transform: capitalize;
}

.badge-success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.badge-danger {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.badge-warning {
    background-color: #fff3cd;
    color: #856404;
    border: 1px solid #ffeeba;
}

.badge-info {
    background-color: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

/* ============================================
   RESPONSIVE
============================================ */
@media (max-width: 768px) {
    .navbar-menu {
        flex-direction: column;
        gap: 0.5rem;
    }

    .job-header {
        flex-direction: column;
        gap: 1rem;
    }

    .job-actions {
        width: 100%;
        flex-direction: column;
    }

    .card-footer {
        flex-direction: column;
    }

    table {
        font-size: 0.875rem;
    }

    th, td {
        padding: 0.5rem;
    }
}

/* ============================================
   MODAL
============================================ */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    padding: 1rem;
}

.modal.hidden {
    display: none;
}

.modal-content {
    background: var(--color-white);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    max-width: 500px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    animation: modalFadeIn 0.3s ease-out;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid var(--color-border);
}

.modal-header h3 {
    margin: 0;
    color: var(--color-dark);
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--color-text);
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.2s;
}

.modal-close:hover {
    background: var(--color-bg);
}

.modal-body {
    padding: 1.5rem;
}

.modal-body p {
    margin-bottom: 1rem;
}

.modal-body ul {
    margin-left: 1.5rem;
    margin-bottom: 1rem;
}

.modal-body li {
    margin-bottom: 0.5rem;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    padding: 1.5rem;
    border-top: 1px solid var(--color-border);
}

/* Modal responsivo */
@media (max-width: 768px) {
    .modal-content {
        max-width: 100%;
        margin: 1rem;
    }

    .modal-footer {
        flex-direction: column-reverse;
    }

    .modal-footer .btn {
        width: 100%;
    }
}
