/**
 * Nartex Widget Styles - v2.1.0
 * Adaptado a los colores corporativos de Nartex Capital
 */

:root {
    --nartex-red: #047857;
    --nartex-red-dark: #065F46;
    --nartex-red-light: #ECFDF5;
    --nartex-gray-900: #1F2937;
    --nartex-gray-700: #374151;
    --nartex-gray-600: #4B5563;
    --nartex-gray-500: #6B7280;
    --nartex-gray-400: #9CA3AF;
    --nartex-gray-300: #D1D5DB;
    --nartex-gray-200: #E5E7EB;
    --nartex-gray-100: #F3F4F6;
    --nartex-gray-50: #F9FAFB;
    --nartex-white: #FFFFFF;
    --nartex-font: 'Lato', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* Widget flotante */
.nartex-widget-trigger {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 65px;
    height: 65px;
    background: var(--nartex-red);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(4, 120, 87, 0.35);
    transition: all 0.3s ease;
    z-index: 999998;
    border: none;
}

.nartex-widget-trigger:hover {
    transform: scale(1.08);
    box-shadow: 0 6px 28px rgba(4, 120, 87, 0.45);
    background: var(--nartex-red-dark);
}

.nartex-widget-trigger svg {
    width: 30px;
    height: 30px;
    fill: var(--nartex-white);
}

/* Modal */
.nartex-widget-modal {
    display: none;
    position: fixed;
    bottom: 110px;
    right: 30px;
    width: 420px;
    max-width: calc(100vw - 60px);
    background: var(--nartex-white);
    border-radius: 16px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    overflow: hidden;
    z-index: 999999;
    font-family: var(--nartex-font);
}

.nartex-widget-modal.active {
    display: flex;
    flex-direction: column;
    animation: nartexSlideUp 0.35s ease;
}

@keyframes nartexSlideUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Header */
.nartex-widget-header {
    background: var(--nartex-red);
    color: var(--nartex-white);
    padding: 24px;
    position: relative;
    flex-shrink: 0;
}

.nartex-widget-close {
    position: absolute;
    top: 16px;
    right: 16px;
    background: rgba(255, 255, 255, 0.15);
    border: none;
    color: var(--nartex-white);
    width: 30px;
    height: 30px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 18px;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.nartex-widget-close:hover {
    background: rgba(255, 255, 255, 0.25);
}

.nartex-widget-header h2 {
    font-size: 1.35rem;
    font-weight: 700;
    margin: 0 0 6px 0;
    letter-spacing: -0.3px;
}

.nartex-widget-header p {
    font-size: 0.9rem;
    margin: 0;
    opacity: 0.9;
}

/* Body */
.nartex-widget-body {
    padding: 24px;
    max-height: 480px;
    overflow-y: auto;
    flex: 1;
}

/* Progress bar */
.nartex-progress-bar {
    height: 3px;
    background: var(--nartex-gray-200);
    border-radius: 3px;
    margin-bottom: 20px;
    overflow: hidden;
}

.nartex-progress-fill {
    height: 100%;
    background: var(--nartex-red);
    transition: width 0.4s ease;
    width: 33%;
}

/* Steps */
.nartex-step {
    display: none;
}

.nartex-step.active {
    display: block;
    animation: nartexFadeIn 0.3s ease;
}

@keyframes nartexFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.nartex-step-title {
    font-size: 1.2rem;
    color: var(--nartex-gray-900);
    margin: 0 0 12px 0;
    font-weight: 700;
    letter-spacing: -0.3px;
}

.nartex-step-description {
    color: var(--nartex-gray-500);
    margin: 0 0 20px 0;
    line-height: 1.6;
    font-size: 0.95rem;
}

/* Bank grid */
.nartex-bank-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
}

.nartex-bank-option {
    border: 1px solid var(--nartex-gray-200);
    border-radius: 10px;
    padding: 14px 16px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--nartex-white);
    text-align: left;
    width: 100%;
}

.nartex-bank-option:hover {
    border-color: var(--nartex-red);
    background: var(--nartex-red-light);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(4, 120, 87, 0.1);
}

.nartex-bank-logo {
    width: 42px;
    height: 42px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.7rem;
    color: var(--nartex-gray-600);
    flex-shrink: 0;
    overflow: hidden;
    background: var(--nartex-white);
    border: 1px solid var(--nartex-gray-200);
}

.nartex-bank-logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 6px;
}

/* Bank colors (fallback when image fails to load) */
.nartex-bank-logo.openbank { background: #00a3e0; }
.nartex-bank-logo.renta4 { background: #003366; }
.nartex-bank-logo.andbank { background: #1a1a1a; }
.nartex-bank-logo.bbva { background: #004481; }
.nartex-bank-logo.caixabank { background: #007fc5; }
.nartex-bank-logo.santander { background: #ec0000; }
.nartex-bank-logo.bankinter { background: #ff6600; }
.nartex-bank-logo.myinvestor { background: #6366f1; }
.nartex-bank-logo.traderepublic { background: #1a1a1a; }
.nartex-bank-logo.selfbank { background: #e91e63; }
.nartex-bank-logo.deutschebank { background: #0018a8; }
.nartex-bank-logo.unicaja { background: #00a651; }
.nartex-bank-logo.ebnbanco { background: #2d3748; }
.nartex-bank-logo.ironia { background: #6B21A8; }

.nartex-bank-info {
    flex: 1;
    text-align: left;
    min-width: 0;
}

.nartex-bank-name {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--nartex-gray-900);
    margin-bottom: 2px;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
}

.nartex-bank-detail {
    font-size: 0.8rem;
    color: var(--nartex-gray-500);
    display: block;
}

/* Process steps */
.nartex-process-steps {
    background: var(--nartex-gray-50);
    border-radius: 10px;
    padding: 18px;
    margin-bottom: 16px;
}

.nartex-process-step {
    display: flex;
    gap: 14px;
    margin-bottom: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--nartex-gray-200);
}

.nartex-process-step:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.nartex-step-number {
    width: 26px;
    height: 26px;
    background: var(--nartex-red);
    color: var(--nartex-white);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.8rem;
    flex-shrink: 0;
}

.nartex-step-content h4 {
    color: var(--nartex-gray-900);
    margin: 0 0 4px 0;
    font-size: 0.9rem;
    font-weight: 600;
}

.nartex-step-content p {
    color: var(--nartex-gray-600);
    font-size: 0.85rem;
    line-height: 1.5;
    margin: 0;
}

.nartex-step-content code {
    background: var(--nartex-gray-200);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.8rem;
    color: var(--nartex-gray-700);
    font-family: 'Courier New', monospace;
}

.nartex-step-content a {
    color: var(--nartex-red);
    text-decoration: none;
    font-weight: 600;
}

.nartex-step-content a:hover {
    text-decoration: underline;
}

/* Info boxes */
.nartex-info-box {
    background: var(--nartex-gray-50);
    border-left: 3px solid var(--nartex-gray-400);
    padding: 14px;
    border-radius: 0 8px 8px 0;
    margin-bottom: 14px;
}

.nartex-info-box h4 {
    color: var(--nartex-gray-700);
    margin: 0 0 8px 0;
    font-size: 0.85rem;
    font-weight: 700;
}

.nartex-info-box ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.nartex-info-box li {
    color: var(--nartex-gray-600);
    font-size: 0.85rem;
    margin-bottom: 4px;
    padding-left: 16px;
    position: relative;
    line-height: 1.4;
}

.nartex-info-box li:last-child {
    margin-bottom: 0;
}

.nartex-info-box li:before {
    content: "•";
    position: absolute;
    left: 0;
    color: var(--nartex-red);
    font-weight: 700;
}

.nartex-warning-box {
    background: #FEF3C7;
    border-left: 3px solid #D97706;
    padding: 14px;
    border-radius: 0 8px 8px 0;
    margin-bottom: 14px;
}

.nartex-warning-box p {
    color: #92400E;
    font-size: 0.85rem;
    line-height: 1.5;
    margin: 0;
}

.nartex-warning-box strong {
    color: #78350F;
}

/* Fee badges */
.nartex-fee-badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
}

.nartex-fee-free {
    background: #ECFDF5;
    color: #047857;
}

.nartex-fee-low {
    background: #EFF6FF;
    color: #1D4ED8;
}

.nartex-fee-medium {
    background: var(--nartex-gray-100);
    color: var(--nartex-gray-600);
}

.nartex-fee-high {
    background: #FEF2F2;
    color: #B91C1C;
}

.nartex-fee-consult {
    background: var(--nartex-gray-100);
    color: var(--nartex-gray-500);
    font-style: italic;
}

.nartex-bank-header {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

/* Custodia box */
.nartex-custodia-box {
    background: var(--nartex-gray-50);
    border-radius: 8px;
    padding: 14px;
    margin-bottom: 14px;
}

.nartex-custodia-box h4 {
    font-size: 0.85rem;
    color: var(--nartex-gray-700);
    margin: 0 0 10px 0;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
}

.nartex-custodia-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid var(--nartex-gray-200);
    font-size: 0.85rem;
}

.nartex-custodia-item:last-child {
    border-bottom: none;
}

.nartex-custodia-label {
    color: var(--nartex-gray-600);
}

.nartex-custodia-value {
    font-weight: 600;
    color: var(--nartex-gray-900);
}

.nartex-custodia-value.gratis {
    color: #065F46;
}

.nartex-custodia-value.caro {
    color: #991B1B;
}

.nartex-custodia-note {
    margin-top: 10px;
    padding: 10px;
    background: #ECFDF5;
    border-radius: 6px;
    font-size: 0.8rem;
    color: #065F46;
}

.nartex-custodia-note.warning {
    background: #FEF3C7;
    color: #92400E;
}

.nartex-custodia-note.danger {
    background: #FEE2E2;
    color: #991B1B;
}

/* Contact box */
.nartex-contact-box {
    background: var(--nartex-gray-100);
    border-radius: 8px;
    padding: 12px 14px;
    margin-top: 14px;
}

.nartex-contact-box h4 {
    font-size: 0.8rem;
    color: var(--nartex-gray-600);
    margin: 0 0 6px 0;
    font-weight: 700;
}

.nartex-contact-box p {
    font-size: 0.8rem;
    color: var(--nartex-gray-500);
    margin: 0 0 2px 0;
}

.nartex-contact-box a {
    color: var(--nartex-red);
    text-decoration: none;
    font-weight: 600;
}

.nartex-contact-box a:hover {
    text-decoration: underline;
}

/* Buttons */
.nartex-btn {
    background: var(--nartex-red);
    color: var(--nartex-white);
    border: none;
    padding: 12px 20px;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    flex: 1;
    font-family: var(--nartex-font);
}

.nartex-btn:hover {
    background: var(--nartex-red-dark);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(4, 120, 87, 0.25);
}

.nartex-btn-secondary {
    background: var(--nartex-gray-100);
    color: var(--nartex-gray-600);
}

.nartex-btn-secondary:hover {
    background: var(--nartex-gray-200);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.nartex-button-group {
    display: flex;
    gap: 10px;
    margin-top: 16px;
}

/* Footer */
.nartex-widget-footer {
    padding: 14px 24px;
    background: var(--nartex-gray-50);
    border-top: 1px solid var(--nartex-gray-200);
    text-align: center;
    flex-shrink: 0;
}

.nartex-widget-footer p {
    color: var(--nartex-gray-500);
    font-size: 0.8rem;
    margin: 0;
}

.nartex-widget-footer a {
    color: var(--nartex-red);
    text-decoration: none;
    font-weight: 600;
}

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

/* Responsive */
@media (max-width: 480px) {
    .nartex-widget-modal {
        bottom: 0;
        right: 0;
        left: 0;
        width: 100%;
        max-width: 100%;
        border-radius: 16px 16px 0 0;
    }

    .nartex-widget-trigger {
        bottom: 20px;
        right: 20px;
        width: 58px;
        height: 58px;
    }

    .nartex-widget-trigger svg {
        width: 26px;
        height: 26px;
    }
}

/* Scrollbar */
.nartex-widget-body::-webkit-scrollbar {
    width: 5px;
}

.nartex-widget-body::-webkit-scrollbar-track {
    background: var(--nartex-gray-100);
}

.nartex-widget-body::-webkit-scrollbar-thumb {
    background: var(--nartex-gray-300);
    border-radius: 3px;
}

.nartex-widget-body::-webkit-scrollbar-thumb:hover {
    background: var(--nartex-gray-400);
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    .nartex-widget-modal,
    .nartex-step,
    .nartex-widget-trigger {
        animation: none;
        transition: none;
    }
}

/* Box sizing */
.nartex-widget-trigger,
.nartex-widget-modal,
.nartex-widget-modal *,
.nartex-widget-modal *::before,
.nartex-widget-modal *::after {
    box-sizing: border-box;
}
