/* =========================================================
   Validador de Especies - Estilos principales
   ========================================================= */

/* ==================== VARIABLES CSS ==================== */
:root {
    /* Colores Primarios - Azul Oceánico (Científico/Ecológico) */
    --color-primary: #0ea5a4;        /* teal océano */
    --color-primary-dark: #115e59;   /* teal profundo */
    --color-primary-light: #5eead4;  /* teal claro */
    --color-primary-hover: #0d9488;  /* teal hover */
    
    /* Colores de Estado */
    --color-success: #10b981;
    --color-error: #ef4444;
    --color-warning: #f59e0b;
    --color-info: #0ea5a4;
    
    /* Colores de Texto - Mejorado contraste */
    --text-primary: #1f2937;
    --text-secondary: #6b7280;
    --text-muted: #6b7280;          /* mejor contraste que #9ca3af */
    
    /* Colores de Fondo - Gradiente oscuro oceánico */
    --bg-gradient-start: #0f172a;   /* azul marino oscuro */
    --bg-gradient-end: #134e4a;     /* teal oscuro */
    --bg-card: #ffffff;
    --bg-gray-light: #f0fdfa;       /* tinte teal suave */
    --bg-gray: #f3f4f6;
    
    /* Bordes */
    --border-color: #e5e7eb;
    --border-color-dark: #d1d5db;
    
    /* Sombras - Más elegantes y sutiles */
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 6px 16px rgba(0, 0, 0, 0.12);
    --shadow-lg: 0 6px 16px rgba(0, 0, 0, 0.12);
    
    /* Transparencias para efectos */
    --primary-alpha-10: rgba(14, 165, 164, 0.1);
    --primary-alpha-20: rgba(14, 165, 164, 0.2);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* ==================== UTILITY CLASSES ==================== */

.hidden {
    display: none !important;
}

.badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-success {
    background: rgba(16, 185, 129, 0.1);
    color: var(--color-success);
}

.badge-info {
    background: rgba(59, 130, 246, 0.1);
    color: var(--color-info);
}

.badge-error {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}

.text-muted {
    color: #9ca3af;
}

/* Auth Tabs */
.auth-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 24px;
    border-bottom: 2px solid #e5e7eb;
}

.auth-tab {
    flex: 1;
    padding: 12px;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    cursor: pointer;
    font-size: 15px;
    font-weight: 500;
    color: #6b7280;
    transition: all 0.2s ease;
}

.auth-tab:hover {
    color: var(--color-primary);
}

.auth-tab.active {
    color: var(--color-primary);
    border-bottom-color: var(--color-primary);
}

.auth-tab-content {
    display: none;
}

.auth-tab-content.active {
    display: block;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background: linear-gradient(135deg, var(--bg-gradient-start) 0%, var(--bg-gradient-end) 100%);
    min-height: 100vh;
    padding: 20px;
    color: #ffffff;
}

/* Títulos principales sobre fondo oscuro */
.container > h1,
.container > h2,
.container > h3,
.container > .subtitle {
    color: #ffffff !important;
}

/* Cards con fondo blanco */
.card {
    background: white;
    padding: 40px;
    border-radius: 15px;
    box-shadow: var(--shadow-md);
    margin-bottom: 30px;
}

.card h1,
.card h2,
.card h3,
.card p {
    color: var(--text-primary);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
}

/* ==================== HEADER ==================== */

.header {
    background: white;
    padding: 20px 30px;
    border-radius: 15px;
    margin-bottom: 30px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 24px;
    font-weight: bold;
    color: var(--color-primary);
}

.logo-img {
    height: 40px;
    width: auto;
}

.product-name {
    font-size: 24px;
    font-weight: 600;
    color: var(--color-primary);
}

.user-info {
    display: flex;
    gap: 15px;
    align-items: center;
}

.user-bar {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
}

.user-bar > * {
    flex-shrink: 0;
}

.user-bar #user-email {
    margin: 0;
    padding: 0;
    color: #6b7280;
    font-size: 14px;
}

.credits-badge {
    background: var(--color-primary);
    color: white;
    padding: 10px 20px;
    border-radius: 25px;
    font-weight: bold;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

/* ==================== BUTTONS ==================== */

.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    text-decoration: none;
    display: inline-block;
    transition: all 0.3s;
    font-weight: 500;
}

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

.btn-primary:hover {
    background: var(--color-primary-hover);
    transform: translateY(-2px);
}

.btn-secondary {
    background: #f3f4f6;
    color: #374151;
}

.btn-secondary:hover {
    background: #e5e7eb;
}

.btn-large {
    width: 100%;
    padding: 15px;
    font-size: 16px;
}

.btn-clear {
    background: #ef4444;
    color: white;
    border: none;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    cursor: pointer;
    font-size: 14px;
}

/* ==================== HERO ==================== */

.hero {
    background: white;
    padding: 60px 40px;
    border-radius: 15px;
    margin-bottom: 30px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    text-align: center;
}

.hero h1 {
    font-size: 36px;
    color: #1f2937;
    margin-bottom: 15px;
}

.subtitle {
    font-size: 18px;
    color: #9ca3af;
    max-width: 800px;
    margin: 0 auto;
}

/* Welcome Banner */
.welcome-banner {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    padding: 32px;
    margin-bottom: 30px;
    text-align: center;
}

.welcome-banner h1 {
    font-size: 32px;
    color: #ffffff;
    margin-bottom: 8px;
    font-weight: 600;
}

.welcome-banner p {
    font-size: 16px;
    color: #d1d5db;
    margin: 0;
}

/* ==================== MAIN CONTENT ==================== */

.main-content {
    background: white;
    padding: 40px;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    margin-bottom: 30px;
}

.main-content h2 {
    color: #1f2937;
    margin-bottom: 15px;
}

/* ==================== LOGIN FORM ==================== */

.login-form {
    max-width: 500px;
    margin: 0 auto;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    color: #374151;
    font-weight: 500;
    margin-bottom: 8px;
}

.form-group input {
    width: 100%;
    padding: 12px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 14px;
}

.form-group input:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px var(--primary-alpha-10);
}

/* ==================== UPLOAD AREA ==================== */

.upload-area {
    border: 3px dashed #d1d5db;
    border-radius: 15px;
    padding: 60px 40px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    margin-bottom: 20px;
}

.upload-area:hover {
    border-color: var(--color-primary);
    background: var(--bg-gray-light);
}

.upload-area.drag-over {
    border-color: var(--color-primary);
    background: #eef2ff;
}

.upload-icon {
    font-size: 64px;
    margin-bottom: 20px;
}

.upload-text {
    font-size: 18px;
    color: #374151;
    margin-bottom: 10px;
}

.upload-link {
    color: var(--color-primary);
    text-decoration: underline;
    cursor: pointer;
}

.upload-hint {
    color: #9ca3af;
    font-size: 14px;
}

/* ==================== FILE INFO ==================== */

.file-info {
    background: #f9fafb;
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 20px;
}

.file-name {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: white;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 15px;
}

/* ==================== UPLOAD PROGRESS ==================== */

.upload-progress {
    text-align: center;
    padding: 40px;
}

.loader {
    border: 4px solid var(--bg-gray);
    border-top: 4px solid var(--color-primary);
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

#upload-status {
    color: #6b7280;
    font-size: 16px;
}

/* ==================== FEATURES GRID ==================== */

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.feature-card {
    background: white;
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    text-align: center;
}

.feature-icon {
    font-size: 48px;
    margin-bottom: 15px;
}

.feature-card h3 {
    color: #1f2937;
    margin-bottom: 10px;
}

.feature-card p {
    color: #6b7280;
    font-size: 14px;
}

/* ==================== MODAL ==================== */

.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.5);
    align-items: center;
    justify-content: center;
}

.modal-content {
    background-color: white;
    padding: 30px;
    border-radius: 15px;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

.close {
    color: #9ca3af;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.close:hover {
    color: #374151;
}

/* ==================== DASHBOARD ==================== */

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: white;
    padding: 25px;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

.stat-card h3 {
    color: #6b7280;
    font-size: 14px;
    margin-bottom: 10px;
    text-transform: uppercase;
}

.stat-value {
    font-size: 36px;
    font-weight: bold;
    color: #1f2937;
    margin-bottom: 10px;
}

.stat-card.credits .stat-value {
    color: #16a34a;
}

.stat-card.pdfs .stat-value {
    color: var(--color-primary);
}

/* ==================== FOOTER ==================== */

.footer {
    text-align: center;
    padding: 30px;
    color: white;
}

/* ==================== BUY CREDITS PAGE ==================== */

.current-balance-box {
    text-align: center;
    background: linear-gradient(135deg, var(--bg-gradient-start) 0%, var(--bg-gradient-end) 100%);
    padding: 30px;
    border-radius: 16px;
    color: white;
    margin: 30px 0;
}

.balance-label {
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 1px;
    opacity: 0.9;
}

.balance-amount {
    font-size: 48px;
    font-weight: 700;
    margin: 10px 0;
}

.balance-sublabel {
    font-size: 14px;
    opacity: 0.8;
}

.packages-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
    margin: 40px 0;
}

.package-card {
    background: white;
    border-radius: 16px;
    padding: 32px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.07);
    position: relative;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.package-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.15);
}

.package-card.popular {
    border: 2px solid var(--color-primary);
    box-shadow: 0 8px 16px rgba(102, 126, 234, 0.2);
}

.package-card.popular::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--bg-gradient-start) 0%, var(--bg-gradient-end) 100%);
    border-radius: 16px 16px 0 0;
}

.package-card .badge {
    position: absolute;
    top: 16px;
    right: 16px;
    background: linear-gradient(135deg, var(--bg-gradient-start) 0%, var(--bg-gradient-end) 100%);
    color: white;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.package-card .savings-badge {
    top: auto;
    bottom: 16px;
    right: 16px;
    background: linear-gradient(135deg, var(--color-primary-light) 0%, var(--color-primary-hover) 100%);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.package-name {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 16px;
    color: #1f2937;
}

.package-price {
    margin-bottom: 24px;
}

.package-price .amount {
    font-size: 42px;
    font-weight: 700;
    color: var(--color-primary);
}

.package-price .clp-price {
    font-size: 13px;
    color: #9ca3af;
    margin-top: 4px;
    font-weight: 400;
}

.package-price .credits {
    font-size: 16px;
    color: #6b7280;
    margin-top: 8px;
    font-weight: 600;
}

.package-price .pages-info {
    font-size: 14px;
    color: #9ca3af;
    margin-top: 4px;
}

.package-features {
    list-style: none;
    padding: 0;
    margin: 0 0 24px 0;
}

.package-features li {
    padding: 8px 0;
    color: #4b5563;
    font-size: 14px;
}

.package-best-for {
    font-size: 13px;
    color: #6b7280;
    font-style: italic;
    margin-bottom: 24px;
    min-height: 40px;
}

.btn-purchase {
    width: 100%;
    padding: 14px;
    font-size: 16px;
    font-weight: 600;
    background: linear-gradient(135deg, var(--bg-gradient-start) 0%, var(--bg-gradient-end) 100%);
    color: white;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-purchase:hover {
    transform: scale(1.02);
    box-shadow: 0 8px 16px rgba(102, 126, 234, 0.3);
}

.info-section {
    background: #f9fafb;
    padding: 24px;
    border-radius: 12px;
    margin-top: 40px;
}

.info-section h4 {
    font-size: 16px;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 12px;
}

.info-section p {
    font-size: 14px;
    color: #6b7280;
    margin: 6px 0;
}

.processing-message {
    text-align: center;
    padding: 40px;
    background: #f0f9ff;
    border-radius: 12px;
    margin: 20px 0;
}

.processing-message p {
    margin-top: 16px;
    color: var(--color-primary);
    font-weight: 600;
}

/* ==================== TABLES ==================== */

.table-container {
    overflow-x: auto;
    margin: 20px 0;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    font-size: 14px;
}

thead {
    background: linear-gradient(135deg, var(--bg-gradient-start) 0%, var(--bg-gradient-end) 100%);
    color: white;
}

th {
    padding: 16px;
    text-align: left;
    font-weight: 600;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 2px solid rgba(255, 255, 255, 0.2);
}

tbody tr {
    border-bottom: 1px solid #e5e7eb;
    transition: background-color 0.2s ease;
}

tbody tr:hover {
    background-color: #f8f9ff;
}

tbody tr:last-child {
    border-bottom: none;
}

td {
    padding: 16px;
    color: #374151;
    vertical-align: middle;
}

td:first-child {
    font-weight: 500;
    color: #1f2937;
}

/* ==================== RESPONSIVE ==================== */

@media (max-width: 768px) {
    .header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    
    .user-bar {
        width: 100%;
        flex-wrap: wrap;
        justify-content: flex-start;
    }
    
    .user-info {
        flex-direction: column;
        width: 100%;
    }
    
    .credits-badge {
        width: 100%;
        text-align: center;
        justify-content: center;
    }
    
    .hero h1 {
        font-size: 28px;
    }
    
    .features-grid,
    .stats-grid,
    .packages-grid {
        grid-template-columns: 1fr;
    }
}

