/* ============================================================================
   ESTILOS VERIFACTU
   ============================================================================ */

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
    color: #333;
}

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

header {
    background: white;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
    text-align: center;
}

header h1 {
    color: #667eea;
    margin-bottom: 10px;
}

.subtitle {
    color: #666;
    font-size: 14px;
}

.card {
    background: white;
    padding: 25px;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
}

.card h2 {
    color: #667eea;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #f0f0f0;
}

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

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: #555;
}

input[type="text"],
input[type="password"],
input[type="number"],
input[type="date"],
input[type="file"],
select,
textarea {
    width: 100%;
    padding: 10px;
    border: 2px solid #e0e0e0;
    border-radius: 5px;
    font-size: 14px;
    transition: border-color 0.3s;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: #667eea;
}

input[readonly] {
    background-color: #f5f5f5;
    cursor: not-allowed;
}

small {
    display: block;
    margin-top: 5px;
    color: #888;
    font-size: 12px;
}

/* Botones */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 5px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    display: inline-block;
    text-decoration: none;
}

.btn-primary {
    background: #667eea;
    color: white;
}

.btn-primary:hover {
    background: #5568d3;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(102, 126, 234, 0.4);
}

.btn-success {
    background: #10b981;
    color: white;
}

.btn-success:hover {
    background: #059669;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(16, 185, 129, 0.4);
}

.btn-secondary {
    background: #6b7280;
    color: white;
}

.btn-secondary:hover {
    background: #4b5563;
}

/* Información de empresa */
.empresa-info {
    background: #f9fafb;
    padding: 15px;
    border-radius: 5px;
    border-left: 4px solid #667eea;
}

.info-row {
    margin-bottom: 10px;
}

.info-row:last-child {
    margin-bottom: 0;
}

/* Resultados */
.result {
    margin-top: 20px;
    padding: 15px;
    border-radius: 5px;
}

.result-success {
    background: #f0fdf4;
    border: 2px solid #10b981;
    padding: 20px;
    border-radius: 5px;
}

.result-error {
    background: #fef2f2;
    border: 2px solid #ef4444;
    color: #991b1b;
}

.result-item {
    margin-bottom: 15px;
}

.result-item strong {
    display: block;
    margin-bottom: 5px;
    color: #374151;
}

code {
    background: #f3f4f6;
    padding: 8px 12px;
    border-radius: 4px;
    display: block;
    font-family: 'Courier New', monospace;
    font-size: 13px;
    word-break: break-all;
}

#qr-container {
    margin-top: 10px;
    text-align: center;
}

#qr-container canvas {
    border: 2px solid #e5e7eb;
    border-radius: 5px;
    padding: 10px;
    background: white;
}

.actions {
    margin-top: 20px;
    display: flex;
    gap: 10px;
}

/* Historial */
.factura-item {
    background: #f9fafb;
    padding: 15px;
    border-radius: 5px;
    margin-bottom: 10px;
    border-left: 4px solid #667eea;
}

.factura-item.rechazada {
    border-left-color: #ef4444;
}

.factura-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.factura-numero {
    font-weight: 600;
    font-size: 16px;
}

.badge {
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

.badge-success {
    background: #d1fae5;
    color: #065f46;
}

.badge-error {
    background: #fee2e2;
    color: #991b1b;
}

.text-muted {
    color: #9ca3af;
    text-align: center;
    padding: 20px;
}

/* Footer */
footer {
    text-align: center;
    color: white;
    margin-top: 30px;
    padding: 20px;
}

footer p {
    margin: 5px 0;
}

/* Loading */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s ease-in-out infinite;
}

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

/* Responsive */
@media (max-width: 768px) {
    body {
        padding: 10px;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .actions {
        flex-direction: column;
    }
    
    .btn {
        width: 100%;
    }
}
