@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700&display=swap');

:root {
    --bg-primary: #030a16;
    --bg-secondary: rgba(10, 25, 47, 0.7);
    --gold: #d4af37;
    --gold-hover: #f3e5ab;
    --gold-glow: rgba(212, 175, 55, 0.4);
    --blue-accent: #00bcd4;
    --blue-glow: rgba(0, 188, 212, 0.3);
    --text-primary: #f8f9fa;
    --text-secondary: #a0aec0;
    --border-glass: rgba(212, 175, 55, 0.2);
    --border-glass-focus: rgba(212, 175, 55, 0.6);
    --success: #2ec4b6;
    --warning: #ff9f1c;
    --danger: #e71d36;
    --info: #00b4d8;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Outfit', sans-serif;
}

body {
    background-color: var(--bg-primary);
    background-image: 
        radial-gradient(at 10% 20%, rgba(10, 25, 47, 0.8) 0px, transparent 50%),
        radial-gradient(at 90% 80%, rgba(20, 40, 75, 0.6) 0px, transparent 50%),
        radial-gradient(at 50% 50%, rgba(212, 175, 55, 0.05) 0px, transparent 50%);
    background-attachment: fixed;
    background-size: cover;
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
}

/* Glassmorphism Containers */
.glass-container {
    background: var(--bg-secondary);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border-glass);
    border-radius: 16px;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.5);
    transition: all 0.3s ease;
}

.glass-container:hover {
    border-color: rgba(212, 175, 55, 0.3);
    box-shadow: 0 8px 32px 0 rgba(212, 175, 55, 0.1);
}

/* Auth Pages Layout */
.auth-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-grow: 1;
    padding: 2rem 1rem;
}

.auth-card {
    width: 100%;
    max-width: 450px;
    padding: 2.5rem;
}

.auth-header {
    text-align: center;
    margin-bottom: 2rem;
}

.auth-header h1 {
    font-size: 2.2rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: 1px;
    margin-bottom: 0.5rem;
}

.auth-header h1 span {
    color: var(--gold);
    text-shadow: 0 0 10px var(--gold-glow);
}

.auth-header p {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

/* Inputs and Forms */
.form-group {
    margin-bottom: 1.5rem;
    position: relative;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    color: var(--gold);
    font-weight: 500;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.form-control {
    width: 100%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-glass);
    border-radius: 8px;
    padding: 0.75rem 1rem;
    color: var(--text-primary);
    font-size: 1rem;
    outline: none;
    transition: all 0.3s ease;
}

.form-control:focus {
    border-color: var(--border-glass-focus);
    background: rgba(255, 255, 255, 0.08);
    box-shadow: 0 0 12px var(--gold-glow);
}

.form-control::placeholder {
    color: rgba(255, 255, 255, 0.25);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--gold) 0%, #b8932b 100%);
    color: #030a16;
    box-shadow: 0 4px 15px rgba(212, 175, 55, 0.3);
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--gold-hover) 0%, var(--gold) 100%);
    box-shadow: 0 4px 20px var(--gold-glow);
    transform: translateY(-1px);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-glass);
    color: var(--text-primary);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--gold);
    color: var(--gold);
}

.auth-footer {
    text-align: center;
    margin-top: 1.5rem;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.auth-footer a {
    color: var(--gold);
    text-decoration: none;
    font-weight: 600;
}

.auth-footer a:hover {
    text-decoration: underline;
    text-shadow: 0 0 5px var(--gold-glow);
}

/* Main Dashboard Layout */
.dashboard-wrapper {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

header {
    background: rgba(10, 25, 47, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-glass);
    padding: 1rem 2rem;
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.logo {
    display: flex;
    align-items: center;
    font-weight: 700;
    font-size: 1.5rem;
    letter-spacing: 0.5px;
    color: var(--text-primary);
}

.logo span {
    color: var(--gold);
    text-shadow: 0 0 8px var(--gold-glow);
}

.logo-icon {
    margin-right: 0.75rem;
    color: var(--gold);
}

.user-nav {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.user-info {
    text-align: right;
}

.user-name {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text-primary);
}

.user-role {
    font-size: 0.8rem;
    color: var(--gold);
    letter-spacing: 0.5px;
}

.btn-logout {
    padding: 0.4rem 0.8rem;
    font-size: 0.8rem;
    border-radius: 6px;
    width: auto;
}

/* Dashboard Body */
main {
    max-width: 1200px;
    width: 100%;
    margin: 2rem auto;
    padding: 0 1.5rem;
    flex-grow: 1;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
}

@media (min-width: 900px) {
    .dashboard-grid {
        grid-template-columns: 350px 1fr;
    }
}

/* Upload Panel */
.upload-card {
    padding: 2rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    height: fit-content;
}

.dropzone {
    border: 2px dashed rgba(212, 175, 55, 0.3);
    border-radius: 12px;
    padding: 2.5rem 1.5rem;
    text-align: center;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.02);
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
}

.dropzone:hover, .dropzone.dragover {
    border-color: var(--gold);
    background: rgba(212, 175, 55, 0.05);
    box-shadow: inset 0 0 15px rgba(212, 175, 55, 0.1);
}

.dropzone-icon {
    font-size: 2.5rem;
    color: var(--gold);
    margin-bottom: 0.5rem;
}

.dropzone-text h3 {
    font-size: 1.1rem;
    margin-bottom: 0.25rem;
    font-weight: 600;
}

.dropzone-text p {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

#file-input {
    display: none;
}

.progress-container {
    display: none;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    padding: 1rem;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.progress-info {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    margin-bottom: 0.5rem;
    color: var(--text-secondary);
}

.progress-bar-bg {
    background: rgba(0, 0, 0, 0.3);
    height: 6px;
    border-radius: 3px;
    overflow: hidden;
}

.progress-bar-fill {
    background: var(--gold);
    height: 100%;
    width: 0%;
    border-radius: 3px;
    box-shadow: 0 0 8px var(--gold-glow);
    transition: width 0.2s ease;
}

/* Document List / Table */
.docs-card {
    padding: 2rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.card-title-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-glass);
    padding-bottom: 1rem;
}

.card-title-bar h2 {
    font-size: 1.4rem;
    font-weight: 600;
}

.card-title-bar h2 span {
    color: var(--gold);
}

.search-filters {
    display: flex;
    gap: 1rem;
    width: 100%;
    margin-bottom: 0.5rem;
}

.search-filters .form-control {
    flex-grow: 1;
}

/* Document Table Styling */
.table-responsive {
    width: 100%;
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

th {
    padding: 1rem;
    color: var(--gold);
    font-weight: 600;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 2px solid var(--border-glass);
}

td {
    padding: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    font-size: 0.95rem;
    vertical-align: middle;
}

tr:hover td {
    background: rgba(255, 255, 255, 0.02);
}

/* Status Badges */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-pending {
    background: rgba(255, 159, 28, 0.15);
    color: var(--warning);
    border: 1px solid rgba(255, 159, 28, 0.3);
}

.badge-processing {
    background: rgba(0, 180, 216, 0.15);
    color: var(--info);
    border: 1px solid rgba(0, 180, 216, 0.3);
}

.badge-completed {
    background: rgba(46, 196, 182, 0.15);
    color: var(--success);
    border: 1px solid rgba(46, 196, 182, 0.3);
}

.badge-error {
    background: rgba(231, 29, 54, 0.15);
    color: var(--danger);
    border: 1px solid rgba(231, 29, 54, 0.3);
}

/* Table Actions */
.actions-cell {
    display: flex;
    gap: 0.5rem;
}

.btn-icon {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-glass);
    color: var(--text-primary);
    width: 32px;
    height: 32px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.9rem;
}

.btn-icon:hover {
    border-color: var(--gold);
    color: var(--gold);
    background: rgba(212, 175, 55, 0.1);
    box-shadow: 0 0 8px var(--gold-glow);
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 3rem 1.5rem;
    color: var(--text-secondary);
}

.empty-state-icon {
    font-size: 3rem;
    color: var(--border-glass-focus);
    margin-bottom: 1rem;
}

/* View Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(3, 10, 22, 0.8);
    backdrop-filter: blur(8px);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    padding: 1.5rem;
}

.modal-content {
    width: 100%;
    max-width: 800px;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    padding: 2rem;
}

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

.modal-title {
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--gold);
}

.btn-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.5rem;
    cursor: pointer;
    transition: color 0.2s ease;
}

.btn-close:hover {
    color: var(--danger);
}

.modal-body {
    overflow-y: auto;
    flex-grow: 1;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    padding: 1.5rem;
    border: 1px solid rgba(255, 255, 255, 0.05);
    font-size: 1rem;
    line-height: 1.6;
    color: #e2e8f0;
}

.modal-body pre {
    white-space: pre-wrap;
    word-wrap: break-word;
    font-family: 'Courier New', Courier, monospace;
}

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

.modal-footer .btn {
    width: auto;
}

/* CPF & Mask Helper style */
.cpf-error {
    color: var(--danger);
    font-size: 0.8rem;
    margin-top: 0.25rem;
    display: none;
}

/* Toast Notification */
.toast-container {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    z-index: 1050;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.toast {
    background: var(--bg-secondary);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border-glass);
    padding: 1rem 1.5rem;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--text-primary);
    min-width: 280px;
    max-width: 400px;
    transform: translateY(50px);
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.toast.show {
    transform: translateY(0);
    opacity: 1;
}

.toast-success { border-left: 4px solid var(--success); }
.toast-error { border-left: 4px solid var(--danger); }
.toast-info { border-left: 4px solid var(--info); }
