/* Reset y variables CSS */
:root {
    --primary-color: #6366f1;
    --primary-dark: #4f46e5;
    --secondary-color: #10b981;
    --accent-color: #f59e0b;
    --text-primary: #111827;
    --text-secondary: #6b7280;
    --text-light: #9ca3af;
    --bg-primary: #ffffff;
    --bg-secondary: #f9fafb;
    --bg-tertiary: #f3f4f6;
    --border-color: #e5e7eb;
    --border-light: #f3f4f6;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: var(--text-primary);
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
}

/* Container y layout */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 1.5rem;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 0;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: var(--radius-lg);
    margin-top: 1rem;
    padding-left: 2rem;
    padding-right: 2rem;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: white;
}

.logo i {
    font-size: 2rem;
    color: var(--accent-color);
}

.logo h1 {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0;
}

.nav {
    display: flex;
    gap: 1.5rem;
    align-items: center;
}

.nav-link {
    color: white;
    text-decoration: none;
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-md);
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.nav-link:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-1px);
}

/* Main content */
.main {
    flex: 1;
    padding: 2rem 0;
}

/* Hero section */
.hero-section {
    text-align: center;
    padding: 3rem 0;
    color: white;
}

.hero-title {
    font-size: 3.5rem;
    font-weight: 800;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
}

.hero-title i {
    color: var(--accent-color);
}

.hero-subtitle {
    font-size: 1.25rem;
    opacity: 0.9;
    max-width: 600px;
    margin: 0 auto;
}

/* Plans section */
.plans-section {
    background: var(--bg-primary);
    border-radius: var(--radius-xl);
    padding: 3rem 2rem;
    margin-top: 2rem;
    box-shadow: var(--shadow-xl);
    overflow: visible;
    width: 100%;
    max-width: none;
}

.section-header {
    text-align: center;
    margin-bottom: 3rem;
}

.section-header h2 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.section-header p {
    font-size: 1.125rem;
    color: var(--text-secondary);
}

/* Plans grid */
.plans-grid {
    display: flex !important;
    flex-wrap: wrap;
    gap: 1rem;
    margin-top: 3rem;
    max-width: 100%;
    margin-left: auto;
    margin-right: auto;
    width: 100%;
    justify-content: center;
    padding: 1rem 0 0 0;
}

.plans-grid .plan-card {
    flex: 1 1 calc(25% - 0.75rem);
    min-width: 260px;
    max-width: 320px;
}

/* Ensure 4 columns on large screens */
@media (min-width: 1025px) {
    .plans-grid {
        display: flex !important;
        flex-wrap: nowrap !important;
        justify-content: space-between;
    }
    
    .plans-grid .plan-card {
        flex: 1 1 calc(25% - 0.75rem);
        max-width: calc(25% - 0.75rem);
        min-width: 0;
    }
}

.plan-card {
    background: var(--bg-primary);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-xl);
    padding: 1.25rem;
    position: relative;
    transition: all 0.3s ease;
    cursor: pointer;
    min-height: 450px;
    display: flex;
    flex-direction: column;
    max-width: 100%;
}

.plan-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-xl);
    border-color: var(--primary-color);
}

.plan-card.popular {
    border-color: var(--primary-color);
    box-shadow: var(--shadow-lg);
    transform: translateY(-4px);
    padding-top: 2.5rem;
}

.popular-badge {
    position: absolute;
    top: -10px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
    padding: 0.4rem 1.2rem;
    border-radius: var(--radius-lg);
    font-size: 0.8rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    z-index: 10;
    white-space: nowrap;
}

.plan-header {
    text-align: center;
    margin-bottom: 1.5rem;
}

.plan-title {
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.plan-price {
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 0.25rem;
    margin-bottom: 0.5rem;
}

.plan-price .currency {
    font-size: 1.25rem;
    color: var(--text-secondary);
}

.plan-price .amount {
    font-size: 3rem;
    font-weight: 800;
    color: var(--primary-color);
}

.plan-price .period {
    font-size: 1.125rem;
    color: var(--text-secondary);
}

.price-per-month {
    font-size: 0.875rem;
    color: var(--text-light);
}

/* Plan features */
.plan-features {
    margin-bottom: 2rem;
    flex-grow: 1;
}

.feature {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border-light);
}

.feature:last-child {
    border-bottom: none;
}

.feature i {
    color: var(--secondary-color);
    font-size: 1rem;
    width: 18px;
    flex-shrink: 0;
}

.feature.premium i {
    color: var(--accent-color);
}

.feature span {
    font-weight: 500;
    color: var(--text-primary);
    font-size: 0.9rem;
    line-height: 1.3;
}

/* Plan button */
.plan-button {
    width: 100%;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
    border: none;
    padding: 1rem 2rem;
    border-radius: var(--radius-lg);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    margin-top: auto;
}

.plan-button:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.plan-button:active {
    transform: translateY(0);
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
    justify-content: center;
    align-items: center;
    padding: 1rem;
}

.modal.active {
    display: flex;
}

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: 999;
    display: none;
}

.modal-overlay.active {
    display: block;
}

.modal-content {
    background: var(--bg-primary);
    border-radius: var(--radius-xl);
    padding: 2rem;
    max-width: 500px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-xl);
    position: relative;
    z-index: 1001;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.modal-header h3 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: var(--radius-md);
    transition: all 0.2s ease;
}

.modal-close:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

/* Purchase form */
.selected-plan-info {
    background: var(--bg-secondary);
    padding: 1.5rem;
    border-radius: var(--radius-lg);
    margin-bottom: 2rem;
}

.selected-plan-info h4 {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.plan-summary {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.plan-summary .price {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary-color);
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.form-group input[type="email"] {
    width: 100%;
    padding: 0.875rem 1rem;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 1rem;
    transition: all 0.2s ease;
    background: var(--bg-primary);
}

.form-group input[type="email"]:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.input-help {
    font-size: 0.875rem;
    color: var(--text-light);
    margin-top: 0.5rem;
}

/* Payment methods */
.payment-methods-selector {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.payment-method {
    position: relative;
}

.payment-method input[type="radio"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.payment-method label {
    display: block;
    padding: 1.5rem;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: all 0.2s ease;
    background: var(--bg-primary);
}

.payment-method input[type="radio"]:checked + label {
    border-color: var(--primary-color);
    background: rgba(99, 102, 241, 0.05);
}

.payment-method label > span {
    font-weight: 600;
    margin-left: 0.5rem;
}

.payment-icons {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.payment-icons i {
    font-size: 1.5rem;
    opacity: 0.7;
}

.payment-description {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-top: 0.25rem;
}

.crypto-price-note {
    font-size: 0.75rem;
    color: var(--primary-color);
    margin-top: 0.25rem;
    font-weight: 500;
}

.payment-method[data-method="nowpayments"] label {
    border: 2px solid #f7931a;
    position: relative;
    overflow: hidden;
}

.payment-method[data-method="nowpayments"] label::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 0 20px 20px 0;
    border-color: transparent #f7931a transparent transparent;
}

.payment-method[data-method="nowpayments"] input[type="radio"]:checked + label {
    border-color: #f7931a;
    background: rgba(247, 147, 26, 0.05);
}

.payment-method[data-method="nowpayments"] .fab.fa-bitcoin {
    color: #f7931a;
}

/* Form actions */
.form-actions {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
}

.btn-primary, .btn-secondary {
    flex: 1;
    padding: 1rem 2rem;
    border-radius: var(--radius-lg);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    text-align: center;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    border: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-secondary {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: 2px solid var(--border-color);
}

.btn-secondary:hover {
    background: var(--border-color);
}

.loading-spinner {
    display: none;
}

.btn-primary.loading .button-text {
    display: none;
}

.btn-primary.loading .loading-spinner {
    display: flex;
}

/* Success/Error pages */
.success-page, .error-page {
    background: var(--bg-primary);
    border-radius: var(--radius-xl);
    padding: 3rem;
    margin-top: 2rem;
    box-shadow: var(--shadow-xl);
    text-align: center;
}

.success-icon, .error-icon {
    font-size: 4rem;
    margin-bottom: 2rem;
}

.success-icon {
    color: var(--secondary-color);
}

.error-icon {
    color: #ef4444;
}

.success-title, .error-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
}

.success-title {
    color: var(--secondary-color);
}

.error-title {
    color: #ef4444;
}

.success-message, .error-message {
    font-size: 1.125rem;
    color: var(--text-secondary);
    margin-bottom: 2rem;
    line-height: 1.7;
}

.transaction-details {
    background: var(--bg-secondary);
    padding: 2rem;
    border-radius: var(--radius-lg);
    margin: 2rem 0;
    text-align: left;
}

.transaction-details h3 {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    color: var(--text-primary);
    text-align: center;
}

.detail-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border-light);
}

.detail-row:last-child {
    border-bottom: none;
}

.detail-row.highlight {
    background: rgba(99, 102, 241, 0.1);
    padding: 1rem;
    border-radius: var(--radius-md);
    margin-top: 1rem;
    border: none;
}

.detail-row .label {
    font-weight: 600;
    color: var(--text-secondary);
}

.detail-row .value {
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.voucher-code {
    font-family: 'Courier New', monospace;
    background: var(--bg-tertiary);
    padding: 0.5rem 1rem;
    border-radius: var(--radius-md);
    font-size: 1.125rem;
    color: var(--primary-color) !important;
}

.success-actions, .error-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin: 2rem 0;
    flex-wrap: wrap;
}

.help-section {
    background: var(--bg-secondary);
    padding: 2rem;
    border-radius: var(--radius-lg);
    margin-top: 2rem;
    text-align: left;
}

.help-section h4 {
    font-size: 1.125rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.help-section p {
    color: var(--text-secondary);
    line-height: 1.6;
}

/* Footer */
.footer {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: var(--radius-lg);
    margin: 2rem 0 1rem;
    padding: 2rem;
    color: white;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-section h3 {
    font-size: 1.125rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: white;
}

.footer-section p {
    opacity: 0.9;
    line-height: 1.6;
}

.payment-methods {
    display: flex;
    gap: 1rem;
    font-size: 2rem;
    opacity: 0.8;
}

/* Mensaje informativo para criptomonedas no disponibles */
.crypto-unavailable-message {
    margin-top: 1rem;
    padding: 0.75rem 1rem;
    background: linear-gradient(135deg, #fef3c7 0%, #fbbf24 100%);
    border: 1px solid #f59e0b;
    border-radius: var(--radius-md);
    font-size: 0.875rem;
}

.crypto-unavailable-message .info-message {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #92400e;
    line-height: 1.4;
}

.crypto-unavailable-message .fas.fa-info-circle {
    font-size: 1rem;
    color: #f59e0b;
    flex-shrink: 0;
}

/* Responsive design */
@media (max-width: 1024px) {
    .plans-grid {
        flex-wrap: wrap !important;
        justify-content: center;
    }
    
    .plans-grid .plan-card {
        flex: 1 1 calc(50% - 0.75rem) !important;
        min-width: 280px;
        max-width: calc(50% - 0.75rem);
    }
}

@media (max-width: 768px) {
    .container {
        padding: 0 0.5rem;
    }
    
    .header {
        flex-direction: column;
        gap: 1rem;
        padding: 1rem;
    }
    
    .nav {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .hero-title {
        font-size: 2.5rem;
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .plans-section {
        padding: 2rem 1rem;
        margin-top: 1rem;
    }
    
    .plans-grid {
        flex-direction: column !important;
        gap: 1rem;
    }
    
    .plans-grid .plan-card {
        flex: none !important;
        width: 100% !important;
    }
    
    .modal-content {
        margin: 1rem;
        padding: 1.5rem;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .success-actions, .error-actions {
        flex-direction: column;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
}

@media (max-width: 480px) {
    .hero-title {
        font-size: 2rem;
    }
    
    .section-header h2 {
        font-size: 2rem;
    }
    
    .modal-content {
        padding: 1rem;
    }
}
