* {
    box-sizing: border-box;
}

body {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
    width: 100%;
}

html {
    overflow-x: hidden;
}

/* Header */
header {
    width: 100%;
    margin-bottom: 40px;
}

/* Tarjeta principal */
.container.main-card {
    background: white;
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    max-width: 600px;
    width: 100%;
    box-sizing: border-box;
    text-align: center;
    margin-bottom: 24px;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Ícono de estado */
.success-icon {
    font-size: 60px;
    margin-bottom: 20px;
    animation: pulse 0.6s ease-out;
}

@keyframes pulse {
    0% {
        transform: scale(0.8);
        opacity: 0;
    }

    50% {
        transform: scale(1.1);
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

h1 {
    color: #06233a;
    font-size: 28px;
    margin: 0 0 10px 0;
}

p {
    color: #666;
    font-size: 16px;
    line-height: 1.6;
    margin: 0 0 30px 0;
}

/* ── Sección de descarga ── */
.download-section {
    margin: 30px 0;
    padding: 30px 25px;
    background: #f8fafc;
    border-radius: 16px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.03);
    position: relative;
    transition: all 0.3s ease;
}

.download-section:hover {
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.06);
}

.download-section p {
    color: #475569;
    font-size: 15px;
    margin-bottom: 20px;
    font-weight: 500;
}

/* ── Botón Principal de Descarga ── */
#btn-download-pdf {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: #ffffff;
    font-size: 16px;
    font-weight: 700;
    padding: 16px 30px;
    border-radius: 12px;
    border: none;
    cursor: pointer;
    width: 100%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 6px 15px rgba(16, 185, 129, 0.25);
    position: relative;
    overflow: hidden;
    letter-spacing: 0.5px;
}

#btn-download-pdf::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 50%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transform: skewX(-20deg);
    transition: all 0.6s ease;
}

#btn-download-pdf:hover:not(:disabled)::after {
    left: 150%;
}

#btn-download-pdf:hover:not(:disabled) {
    transform: translateY(-3px);
    box-shadow: 0 10px 25px rgba(16, 185, 129, 0.4);
    background: linear-gradient(135deg, #34d399 0%, #059669 100%);
}

#btn-download-pdf:active:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

#btn-download-pdf:disabled {
    background: #e2e8f0;
    color: #94a3b8;
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
}

#btn-download-pdf:disabled::after {
    display: none;
}

/* ── Botón secundario (Respaldo) ── */
.btn-secondary {
    background: #ffffff;
    color: #6366f1;
    font-size: 15px;
    font-weight: 600;
    padding: 14px 24px;
    border-radius: 10px;
    border: 2px solid #e0e7ff;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    margin-top: 15px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
}

.btn-secondary:hover {
    background: #f5f8ff;
    border-color: #c7d2fe;
    color: #4338ca;
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(99, 102, 241, 0.15);
}

.btn-secondary:active {
    transform: translateY(0);
    box-shadow: none;
}

/* ── Info box ── */
.info-box {
    background: #e7f3ff;
    border-left: 4px solid #667eea;
    padding: 15px;
    text-align: left;
    margin: 20px 0;
    border-radius: 4px;
    font-size: 14px;
    color: #333;
}

/* ── Spinner ── */
.spinner {
    border: 3px solid #f3f3f3;
    border-top: 3px solid #667eea;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    animation: spin 1s linear infinite;
    margin: 20px auto;
}

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

    100% {
        transform: rotate(360deg);
    }
}

/* ── Mensajes ── */
.error-message {
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
    padding: 15px;
    border-radius: 4px;
    margin: 20px 0;
    display: none;
}

.success-message {
    background: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
    padding: 15px;
    border-radius: 4px;
    margin: 20px 0;
    display: none;
}

/* ── Badge de estado Wompi ── */
.status-badge {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: bold;
    margin-bottom: 20px;
    text-transform: uppercase;
}

.status-approved {
    background: #d4edda;
    color: #155724;
}

.status-pending {
    background: #fff3cd;
    color: #856404;
}

.status-declined {
    background: #f8d7da;
    color: #721c24;
}

.status-voided {
    background: #e2e3e5;
    color: #383d41;
}

/* ── Utilidades ── */
.canvas-hidden {
    display: none;
}

.field-hidden {
    display: none;
}

.loading-text-small {
    font-size: 14px;
    color: #666;
}

.back-link-container {
    margin-top: 30px;
    font-size: 14px;
    color: #999;
}

.back-link {
    color: #667eea;
    text-decoration: none;
}

.spinner-download {
    display: none;
    margin-top: 10px;
}

/* ── Verificación manual ── */
.manual-verify-section {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px dashed #ddd;
}

.manual-verify-section p {
    font-size: 14px;
    color: #666;
    margin-bottom: 12px;
}

.manual-input-group {
    display: flex;
    gap: 8px;
    max-width: 100%;
    margin: 0 auto;
}

.manual-input-group input {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid #667eea;
    border-radius: 6px;
    font-size: 15px;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.manual-input-group input:focus {
    border-color: #764ba2;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.25);
}

.manual-input-group .btn {
    padding: 12px 22px;
    font-size: 15px;
    font-weight: 700;
    white-space: nowrap;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: opacity 0.2s;
}

.manual-input-group .btn:hover {
    opacity: 0.9;
}

/* ── Secciones Extra ── */
.extra-sections-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    padding: 0 16px;
    box-sizing: border-box;
    margin-top: 24px;
}

@media (min-width: 900px) {
    .extra-sections-wrapper {
        flex-direction: row;
        align-items: stretch;
        justify-content: center;
        gap: 20px;
        max-width: 1300px;
        margin: 40px auto;
        padding: 0 20px;
    }

    .main-card {
        order: 2;
        flex: 1.5;
        margin-bottom: 0 !important;
        max-width: none !important;
        width: auto !important;
    }

    .extra-section {
        flex: 1;
        margin-bottom: 0 !important;
        max-width: none !important;
        width: auto !important;
    }

    .tools-promo-section {
        order: 1;
    }

    .help-section {
        order: 3;
    }
}

.extra-section {
    width: 100%;
    box-sizing: border-box;
    border-radius: 12px;
    padding: 28px 32px;
    margin-bottom: 24px;
    text-align: left;
}

/* ── Estilos Herramientas PDF Pro ── */
.tools-promo-section {
    background: linear-gradient(145deg, #ffffff, #f4f8fa);
    border: 1px solid #e2e8f0;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1);
}

.tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 16px;
}

/* ── Responsividad Móvil Crítica ── */
@media (max-width: 600px) {
    .container.main-card {
        padding: 24px 20px;
    }

    .extra-section {
        padding: 24px 20px;
    }

    h1 {
        font-size: 24px;
    }

    .tools-promo-section {
        padding: 24px 20px !important;
    }

    .tools-grid {
        grid-template-columns: 1fr;
    }

    .manual-input-group {
        flex-direction: column;
    }

    .manual-input-group input {
        width: 100%;
        box-sizing: border-box;
    }

    .manual-input-group .btn {
        width: 100%;
    }
}

.services-section {
    background: white;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1);
}

.services-section h3 {
    color: #06233a;
    font-size: 18px;
    margin-bottom: 12px;
}

.services-section p {
    color: #444;
    font-size: 14px;
    margin-bottom: 8px;
}

.services-section ul {
    padding-left: 20px;
    margin: 0;
}

.services-section ul li {
    color: #667eea;
    font-size: 14px;
    margin-bottom: 6px;
    line-height: 1.5;
}

.help-section {
    background: white;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1);
    border: 1px solid #e2e8f0;
}

.help-section h3 {
    color: var(--primary);
    font-size: 20px;
    margin-bottom: 12px;
}

.help-section p {
    color: var(--muted);
    font-size: 14px;
    margin-bottom: 20px;
}

.contact-link {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 14px 20px;
    margin-bottom: 12px;
    color: #475569;
    font-weight: 600;
    text-decoration: none;
    font-size: 15px;
    transition: all 0.2s ease;
}

.contact-link:hover {
    background: white;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
    border-color: var(--primary);
    color: var(--primary);
}

.whatsapp-link:hover {
    border-color: #22c55e;
    color: #22c55e;
}

.whatsapp-link i {
    color: #22c55e;
}

/* ── Botón Cargar a Google Drive ── */
.btn-gdrive {
    background: #ffffff;
    color: #3c4043;
    font-size: 16px;
    font-weight: 600;
    padding: 14px 24px;
    border-radius: 12px;
    border: 1.5px solid #dadce0;
    cursor: pointer;
    width: 100%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 6px rgba(60, 64, 67, 0.08);
    margin-top: 18px;
}

.btn-gdrive:hover:not(:disabled) {
    background: #f8faff;
    border-color: #4285f4;
    color: #1a73e8;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(66, 133, 244, 0.18);
}

.btn-gdrive:active:not(:disabled) {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(60, 64, 67, 0.08);
}

.btn-gdrive:disabled {
    background: #f1f3f4;
    color: #94a3b8;
    border-color: #e2e8f0;
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
}

.gdrive-success {
    background-color: #e6f4ea;
    border: 1px solid #ceead6;
    color: #137333;
    padding: 14px;
    border-radius: 10px;
    margin-top: 16px;
    font-size: 14px;
    text-align: center;
    line-height: 1.5;
}

.gdrive-error {
    background-color: #fce8e6;
    border: 1px solid #fad2cf;
    color: #c5221f;
    padding: 14px;
    border-radius: 10px;
    margin-top: 16px;
    font-size: 14px;
    text-align: center;
    line-height: 1.5;
}