:root {
    --dtp-purple: #4B0082;
    --dtp-purple-hover: #3A0065;
    --bg-white: #FFFFFF;
    --text-main: #333333;
    --text-muted: #6B7280;
    --border-color: #E5E7EB;
    --input-bg: #F9FAFB;
    --btn-disabled-bg: #E5E7EB;
    --btn-disabled-text: #9CA3AF;
    --error: #DC2626;
    --success: #059669;
}

body {
    margin: 0;
    padding: 0;
    font-family: 'Google Sans', sans-serif;
    background-color: var(--bg-white);
    color: var(--text-main);
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 100vh;
}

/* ================================ */
/* BANDA SUPERIOR MORADA Y LOGO     */
/* ================================ */
.top-banner {
    width: 100%;
    background-color: var(--dtp-purple);
    height: 70px;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    top: 0;
    z-index: 10;
}

.site-logo {
    height: 38px;
    width: auto;
}

/* ================================ */
/* LAYOUT ESTRUCTURA CENTRAL        */
/* ================================ */
.container {
    width: 100%;
    max-width: 450px;
    padding: 4rem 1.5rem;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.auth-section, .dashboard-section {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* ================================ */
/* TIPOGRAFÍAS Y ENCABEZADOS        */
/* ================================ */
h1 {
    font-size: 1.75rem;
    font-weight: 400;
    text-align: center;
    line-height: 1.3;
    margin-bottom: 2.5rem;
    color: #111827;
}

.dash-welcome {
    text-align: center;
    margin-bottom: 2.5rem;
}

.dash-welcome h1 {
    margin-bottom: 0.5rem;
}

.dash-welcome p {
    color: var(--text-muted);
    font-size: 1rem;
    line-height: 1.5;
    margin: 0;
}

/* ================================ */
/* FORMULARIOS E INPUTS             */
/* ================================ */
.clean-form, .upload-form {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.form-group {
    width: 100%;
    position: relative;
}

input[type="email"],
input[type="password"],
input[type="text"] {
    width: 100%;
    padding: 1.1rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    background-color: var(--bg-white);
    font-size: 1rem;
    color: var(--text-main);
    font-family: inherit;
    box-sizing: border-box;
    transition: all 0.2s ease;
}

input:focus {
    outline: none;
    border-color: var(--dtp-purple);
    box-shadow: 0 0 0 3px rgba(75, 0, 130, 0.1);
}

input::placeholder {
    color: #9CA3AF;
}

.password-group {
    position: relative;
}

.password-group input {
    padding-right: 6.5rem;
}

.btn-show-pwd {
    position: absolute;
    right: 0.8rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-family: inherit;
    padding: 0;
}

.btn-show-pwd:hover {
    color: var(--text-main);
}

.btn-show-pwd svg {
    width: 16px;
    height: 16px;
}

/* ================================ */
/* BOTONES PRINCIPALES              */
/* ================================ */
.btn-primary {
    width: 100%;
    padding: 1.1rem;
    border-radius: 12px;
    border: none;
    background-color: var(--btn-disabled-bg);
    color: var(--btn-disabled-text);
    font-size: 1.05rem;
    font-weight: 500;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.2s;
    margin-top: 0.5rem;
    display: flex;
    justify-content: center;
    align-items: center;
}

.btn-primary:not(:disabled):hover, 
.btn-primary.active-btn {
    background-color: var(--dtp-purple);
    color: var(--bg-white);
}

.btn-link {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 0.95rem;
    cursor: pointer;
    margin-top: 1.5rem;
    text-decoration: underline;
}

.btn-link:hover {
    color: var(--text-main);
}

/* ================================ */
/* FOOTER DE LOGIN                  */
/* ================================ */
.footer-help {
    margin-top: 2rem;
    font-size: 0.85rem;
    color: var(--text-main);
    text-align: center;
}

.footer-help a {
    color: #3B82F6;
    text-decoration: none;
    font-weight: 500;
}

.footer-help a:hover {
    text-decoration: underline;
}


/* ================================ */
/* DRAG AND DROP DEL DASHBOARD      */
/* ================================ */
.file-drop-area {
    width: 100%;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2.5rem 1rem;
    border: 2px dashed var(--border-color);
    border-radius: 12px;
    background-color: var(--input-bg);
    transition: all 0.2s ease;
    cursor: pointer;
    text-align: center;
    box-sizing: border-box;
}

.file-drop-area:hover, .file-drop-area.dragover {
    border-color: var(--dtp-purple);
    background-color: rgba(75, 0, 130, 0.03);
}

.file-drop-area svg {
    width: 42px;
    height: 42px;
    color: var(--text-muted);
    margin-bottom: 1rem;
}

.file-message {
    font-size: 1rem;
    color: var(--text-muted);
    pointer-events: none;
}

.file-message strong {
    color: var(--dtp-purple);
    font-weight: 500;
}

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

/* ================================ */
/* ESTADOS / SPINNERS / ERRORES     */
/* ================================ */
.status-message {
    padding: 1rem;
    border-radius: 8px;
    font-size: 0.85rem;
    text-align: center;
    display: none;
    width: 100%;
    box-sizing: border-box;
}

.status-message.error {
    display: block;
    background-color: #FEF2F2;
    color: var(--error);
    border: 1px solid #FCA5A5;
}

.status-message.success {
    display: block;
    background-color: #ECFDF5;
    color: var(--success);
    border: 1px solid #6EE7B7;
}

.spinner {
    display: none;
    width: 18px;
    height: 18px;
    border: 2px solid transparent;
    border-radius: 50%;
    border-top-color: currentColor;
    animation: spin 1s linear infinite;
}

.btn-primary.loading .spinner { display: block; }
.btn-primary.loading .btn-text { display: none; }

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ================================ */
/* HISTORIAL DE ARCHIVOS            */
/* ================================ */
.history-wrapper {
    width: 100%;
    margin-top: 2rem;
    border-top: 1px solid var(--border-color);
    padding-top: 1.5rem;
}

.history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.history-header h3 {
    margin: 0;
    font-size: 1rem;
    color: var(--text-main);
    font-weight: 600;
}

.history-badge {
    background-color: var(--dtp-purple);
    color: white;
    font-size: 0.75rem;
    padding: 0.2rem 0.6rem;
    border-radius: 9999px;
    font-weight: 700;
}

.history-list-container {
    max-height: 200px;
    overflow-y: auto;
    padding-right: 0.5rem;
}

.history-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.history-item {
    background-color: var(--input-bg);
    border: 1px solid var(--border-color);
    padding: 0.8rem;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.history-name {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-main);
    word-break: break-all;
}

.history-date {
    font-size: 0.75rem;
    color: var(--text-muted);
}

