/* =========================================
   EXTRACTA — Upload page
   ========================================= */

/* Fondo de la página */
.upload-page {
    background-color: var(--color-bg);
    min-height: calc(100vh - 64px);
    padding: 60px 20px;
}

/* Título principal */
.upload-title {
    font-size: clamp(1.8rem, 4vw, 2.4rem);
    font-weight: 800;
    text-align: center;
    margin-bottom: 12px;
}

.upload-subtitle {
    text-align: center;
    color: #6b7280;
    font-size: 1rem;
    max-width: 520px;
    margin: 0 auto 40px;
    line-height: 1.6;
}

/* Zona de arrastre */
.drop-zone {
    background: #ffffff;
    border: 2px dashed #d1d5db;
    border-radius: 16px;
    padding: 60px 30px;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.2s ease, background-color 0.2s ease;
    max-width: 700px;
    margin: 0 auto;
}

.drop-zone:hover,
.drop-zone.dragover {
    border-color: var(--color-orange);
    background-color: rgba(245, 166, 35, 0.03);
}

.drop-zone-icon {
    width: 72px;
    height: 72px;
    background-color: rgba(245, 166, 35, 0.12);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
}

.drop-zone h3 {
    font-size: 1.1rem;
    font-weight: 700;
    color: #111827;
    margin-bottom: 6px;
}

.drop-zone p {
    font-size: 0.875rem;
    color: #9ca3af;
    margin-bottom: 0;
}

.drop-zone .file-hint {
    font-size: 0.8rem;
    color: #9ca3af;
    margin-top: 12px;
}

/* Input file oculto */
#fileInput { display: none; }

/* Card de plan */
.plan-card {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    padding: 18px 24px;
    max-width: 700px;
    margin: 20px auto 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.plan-info p  { margin: 0; font-size: 0.875rem; }
.plan-name    { font-weight: 700; color: #111827; }
.plan-detail  { color: #6b7280; }

.plan-progress {
    height: 6px;
    background-color: #f3f4f6;
    border-radius: 999px;
    overflow: hidden;
    margin-top: 8px;
    width: 200px;
}

.plan-progress .fill {
    height: 100%;
    background-color: var(--color-orange);
    border-radius: 999px;
    transition: width 0.3s ease;
}

/* Alertas */
.alert-success-custom {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: 12px;
    padding: 16px 20px;
    max-width: 700px;
    margin: 0 auto 24px;
}

.alert-error-custom {
    background: #fff1f2;
    border: 1px solid #fecdd3;
    border-radius: 12px;
    padding: 16px 20px;
    max-width: 700px;
    margin: 0 auto 24px;
}

/* --- Estado: archivo seleccionado + progreso de subida --- */
.upload-file-card {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    padding: 20px 24px;
    max-width: 700px;
    margin: 0 auto;
}

.upload-file-card .file-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
}

.upload-file-card .file-icon-pdf {
    width: 42px;
    height: 42px;
    background-color: #fef2f2;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.upload-file-card .file-details { flex: 1; }
.upload-file-card .file-details .name { font-weight: 600; font-size: 0.9rem; color: #111827; }
.upload-file-card .file-details .size { font-size: 0.8rem; color: #9ca3af; }

.upload-file-card .btn-remove {
    background: none;
    border: none;
    color: #9ca3af;
    cursor: pointer;
    font-size: 1.1rem;
    padding: 0;
    line-height: 1;
}
.upload-file-card .btn-remove:hover { color: #374151; }

.upload-progress-label {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: 6px;
}

.upload-progress-bar {
    height: 6px;
    background-color: #f3f4f6;
    border-radius: 999px;
    overflow: hidden;
}

.upload-progress-bar .fill {
    height: 100%;
    background-color: var(--color-orange);
    border-radius: 999px;
    width: 0%;
    transition: width 0.3s ease;
}

/* --- Estado: procesando conversión --- */
.processing-card {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    padding: 24px;
    max-width: 700px;
    margin: 0 auto;
}

.processing-card .file-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding-bottom: 16px;
    border-bottom: 1px solid #f3f4f6;
    margin-bottom: 16px;
}

.processing-spinner-sm {
    width: 22px;
    height: 22px;
    border: 2.5px solid #f3f4f6;
    border-top-color: var(--color-orange);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    flex-shrink: 0;
}

/* --- Estado: conversión completada --- */
.result-card {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: 16px;
    padding: 24px;
    max-width: 700px;
    margin: 0 auto;
}

.result-card .result-header {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 16px;
}

.result-card .result-icon {
    width: 46px;
    height: 46px;
    background-color: #dcfce7;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.result-card .file-download-row {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 14px 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
}

.result-card .file-icon-xlsx {
    width: 38px;
    height: 38px;
    background-color: #f0fdf4;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.result-card .result-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

@media (max-width: 480px) {
    .result-card .result-actions { grid-template-columns: 1fr; }
    .plan-progress { width: 100%; margin-top: 10px; }
    .plan-card { flex-direction: column; align-items: flex-start; }
}

/* --- Estado: archivo protegido con contraseña --- */
.password-card {
    background: #fffbf5;
    border: 1px solid #fed7aa;
    border-radius: 16px;
    padding: 24px;
    max-width: 700px;
    margin: 0 auto;
}

.password-card .result-header {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 16px;
}

.password-card .result-icon {
    width: 46px;
    height: 46px;
    background-color: #ffedd5;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.password-card .file-download-row {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 14px 18px;
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.password-card .file-icon-pdf {
    width: 38px;
    height: 38px;
    background-color: #fef2f2;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.card-title {
    font-weight: 700;
    font-size: 0.95rem;
    color: #111827;
    margin: 0;
}

.card-subtitle {
    font-size: 0.8rem;
    color: #6b7280;
    margin: 0;
}

.file-name {
    font-weight: 600;
    font-size: 0.875rem;
    color: #111827;
    margin: 0;
}

.file-meta {
    font-size: 0.75rem;
    color: #9ca3af;
    margin: 0;
}

.password-label {
    display: block;
    font-weight: 600;
    font-size: 0.85rem;
    color: #374151;
    margin-bottom: 6px;
}

.password-input-row {
    display: flex;
    gap: 8px;
}

.password-input-row .form-control {
    font-size: 0.875rem;
}

.password-card .result-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-top: 16px;
}

@media (max-width: 480px) {
    .password-card .result-actions { grid-template-columns: 1fr; }
}