/**
 * Estilos para LP Form NewsAuth
 * Compatible con tema Herald/Meks
 */

/* ============================================
   VARIABLES Y RESET
   ============================================ */
:root {
    --lp-primary: #d92123;
    --lp-primary-dark: #b01d1f;
    --lp-secondary: #1a1a1a;
    --lp-success: #10b981;
    --lp-error: #ef4444;
    --lp-warning: #f59e0b;
    --lp-border: #e5e7eb;
    --lp-text: #374151;
    --lp-text-light: #6b7280;
    --lp-bg-light: #f9fafb;
}

/* ============================================
   CONTENEDORES DE FORMULARIOS
   ============================================ */
.lp-newsauth-form-container {
    max-width: 480px;
    margin: 40px auto;
    padding: 0 20px;
}

.lp-newsauth-form-box {
    background: #fff;
    border-radius: 8px;
    padding: 40px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.lp-newsauth-form-title {
    font-size: 28px;
    font-weight: 700;
    margin: 0 0 30px;
    color: var(--lp-secondary);
    text-align: center;
}

/* ============================================
   TABS DE AUTENTICACIÓN
   ============================================ */
.lp-auth-tabs {
    display: flex;
    gap: 0;
    margin: -40px -40px 30px -40px;
    border-bottom: 2px solid var(--lp-border);
}

.lp-auth-tab {
    flex: 1;
    background: var(--lp-bg-light);
    border: none;
    padding: 16px 24px;
    font-size: 15px;
    font-weight: 600;
    color: var(--lp-text-light);
    cursor: pointer;
    border-bottom: 3px solid transparent;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.lp-auth-tab:first-child {
    border-radius: 8px 0 0 0;
}

.lp-auth-tab:last-child {
    border-radius: 0 8px 0 0;
}

.lp-auth-tab svg {
    width: 18px;
    height: 18px;
}

.lp-auth-tab:hover {
    background: #fff;
    color: var(--lp-primary);
}

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

.lp-auth-form-content {
    display: none;
    animation: fadeIn 0.3s ease-in-out;
}

.lp-auth-form-content.active {
    display: block;
}

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

/* ============================================
   FORMULARIOS
   ============================================ */
.lp-newsauth-form {
    margin: 0;
}

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

.lp-form-group label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--lp-secondary);
}

.lp-form-group input[type="text"],
.lp-form-group input[type="email"],
.lp-form-group input[type="password"] {
    width: 100%;
    padding: 12px 16px;
    font-size: 15px;
    border: 1px solid var(--lp-border);
    border-radius: 6px;
    transition: all 0.2s;
}

.lp-form-group input:focus {
    outline: none;
    border-color: var(--lp-primary);
    box-shadow: 0 0 0 3px rgba(217, 33, 35, 0.1);
}

.lp-form-error {
    display: block;
    color: var(--lp-error);
    font-size: 13px;
    margin-top: 6px;
}

.lp-form-help {
    display: block;
    color: var(--lp-text-light);
    font-size: 13px;
    margin-top: 4px;
}

.lp-form-footer {
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid var(--lp-border);
    text-align: center;
}

.lp-form-footer p {
    margin: 0;
    color: var(--lp-text);
}

.lp-form-footer a {
    color: var(--lp-primary);
    text-decoration: none;
    font-weight: 600;
}

.lp-form-footer a:hover {
    text-decoration: underline;
}

/* ============================================
   BOTONES
   ============================================ */
.lp-btn {
    display: inline-block;
    padding: 12px 24px;
    font-size: 15px;
    font-weight: 600;
    text-align: center;
    text-decoration: none;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
}

.lp-btn-primary {
    background: var(--lp-primary);
    color: #fff;
    width: 100%;
}

.lp-btn-primary:hover:not(:disabled) {
    background: var(--lp-primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(217, 33, 35, 0.3);
}

.lp-btn-secondary {
    background: var(--lp-bg-light);
    color: var(--lp-secondary);
    border: 1px solid var(--lp-border);
}

.lp-btn-secondary:hover:not(:disabled) {
    background: #fff;
    border-color: var(--lp-secondary);
}

.lp-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.lp-btn-loading {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.lp-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

.lp-spinner-small {
    width: 14px;
    height: 14px;
    border-width: 2px;
}

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

/* ============================================
   ALERTAS
   ============================================ */
.lp-alert {
    padding: 12px 16px;
    border-radius: 6px;
    margin-bottom: 20px;
}

.lp-alert-success {
    background: #d1fae5;
    color: #065f46;
    border: 1px solid #6ee7b7;
}

.lp-alert-error {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fca5a5;
}

.lp-alert-warning {
    background: #fef3c7;
    color: #92400e;
    border: 1px solid #fcd34d;
}

/* ============================================
   PLANES
   ============================================ */
.lp-planes-container {
    max-width: 1200px;
    margin: 40px auto;
    padding: 0 20px;
}

.lp-planes-header {
    text-align: center;
    margin-bottom: 50px;
}

.lp-planes-header h2 {
    font-size: 36px;
    font-weight: 700;
    margin: 0 0 16px;
    color: var(--lp-secondary);
}

.lp-planes-header p {
    font-size: 18px;
    color: var(--lp-text-light);
    margin: 0;
}

.lp-planes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.lp-plan-card {
    background: #fff;
    border: 2px solid var(--lp-border);
    border-radius: 12px;
    padding: 32px;
    position: relative;
    transition: all 0.3s;
}

.lp-plan-card:hover {
    border-color: var(--lp-primary);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    transform: translateY(-4px);
}

.lp-plan-featured {
    border-color: var(--lp-primary);
    box-shadow: 0 10px 40px rgba(217, 33, 35, 0.15);
}

.lp-plan-badge {
    position: absolute;
    top: -12px;
    right: 24px;
    background: var(--lp-primary);
    color: #fff;
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
}

.lp-plan-header h3 {
    font-size: 24px;
    font-weight: 700;
    margin: 0 0 8px;
    color: var(--lp-secondary);
}

.lp-plan-description {
    font-size: 15px;
    color: var(--lp-text-light);
    margin: 0 0 24px;
}

.lp-plan-price {
    margin-bottom: 24px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--lp-border);
}

.lp-price-amount {
    display: block;
    font-size: 42px;
    font-weight: 700;
    color: var(--lp-secondary);
    line-height: 1;
}

.lp-price-duration {
    display: block;
    font-size: 14px;
    color: var(--lp-text-light);
    margin-top: 8px;
}

.lp-plan-features {
    list-style: none;
    padding: 0;
    margin: 0 0 32px;
}

.lp-plan-features li {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 12px;
    font-size: 15px;
    color: var(--lp-text);
}

.lp-plan-features svg {
    flex-shrink: 0;
    color: var(--lp-success);
    margin-top: 2px;
}

.lp-plan-action {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* ============================================
   MODALES
   ============================================ */
.lp-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
}

.lp-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
}

.lp-modal-content {
    position: relative;
    background: #fff;
    max-width: 500px;
    margin: 60px auto;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    max-height: calc(100vh - 120px);
    overflow-y: auto;
}

.lp-modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: none;
    border: none;
    font-size: 32px;
    line-height: 1;
    color: var(--lp-text-light);
    cursor: pointer;
    z-index: 10;
}

.lp-modal-close:hover {
    color: var(--lp-secondary);
}

.lp-modal-header {
    padding: 32px 32px 24px;
    text-align: center;
    border-bottom: 1px solid var(--lp-border);
}

.lp-modal-header h3 {
    font-size: 24px;
    font-weight: 700;
    margin: 0 0 8px;
    color: var(--lp-secondary);
}

.lp-modal-header p {
    margin: 0;
    color: var(--lp-text-light);
}

.lp-modal-body {
    padding: 32px;
}

/* QR Modal específico */
.lp-qr-loading {
    text-align: center;
    padding: 40px 0;
}

.lp-qr-loading .lp-spinner {
    width: 40px;
    height: 40px;
    border-width: 4px;
    border-color: var(--lp-border);
    border-top-color: var(--lp-primary);
    margin: 0 auto 16px;
}

.lp-qr-loading p {
    color: var(--lp-text-light);
    margin: 0;
}

.lp-qr-image-container {
    text-align: center;
    margin-bottom: 24px;
}

.lp-qr-image-container img {
    max-width: 300px;
    width: 100%;
    height: auto;
    border: 4px solid var(--lp-border);
    border-radius: 8px;
}

.lp-qr-actions {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
}

.lp-qr-actions .lp-btn {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.lp-qr-status {
    text-align: center;
    margin-bottom: 20px;
}

#lp-qr-polling {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--lp-text-light);
    font-size: 14px;
}

.lp-qr-info {
    background: var(--lp-bg-light);
    border-radius: 6px;
    padding: 16px;
    text-align: center;
}

.lp-qr-info p {
    margin: 0 0 8px;
    font-size: 14px;
    color: var(--lp-text);
}

.lp-qr-info p:last-child {
    margin-bottom: 0;
}

.lp-qr-success {
    text-align: center;
    padding: 40px 20px;
}

.lp-qr-success svg {
    margin-bottom: 24px;
}

.lp-qr-success h3 {
    font-size: 24px;
    font-weight: 700;
    margin: 0 0 12px;
    color: var(--lp-success);
}

.lp-qr-success p {
    color: var(--lp-text);
    margin: 0 0 24px;
}

/* ============================================
   MI CUENTA
   ============================================ */
.lp-cuenta-container {
    max-width: 1000px;
    margin: 40px auto;
    padding: 0 20px;
}

.lp-cuenta-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.lp-cuenta-header h2 {
    font-size: 32px;
    font-weight: 700;
    margin: 0;
    color: var(--lp-secondary);
}

.lp-cuenta-tabs {
    display: flex;
    gap: 8px;
    border-bottom: 2px solid var(--lp-border);
    margin-bottom: 32px;
    overflow-x: auto;
}

.lp-tab-btn {
    background: none;
    border: none;
    padding: 12px 20px;
    font-size: 15px;
    font-weight: 600;
    color: var(--lp-text-light);
    cursor: pointer;
    border-bottom: 3px solid transparent;
    transition: all 0.2s;
    white-space: nowrap;
}

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

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

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

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

.lp-card {
    background: #fff;
    border: 1px solid var(--lp-border);
    border-radius: 8px;
    padding: 32px;
    margin-bottom: 24px;
}

.lp-card h3 {
    font-size: 20px;
    font-weight: 700;
    margin: 0 0 24px;
    color: var(--lp-secondary);
}

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

.lp-cuenta-form button[type="submit"] {
    width: auto;
    min-width: 200px;
}

/* Suscripción */
.lp-suscripcion-card {
    background: var(--lp-bg-light);
    border-radius: 8px;
    padding: 24px;
    position: relative;
}

.lp-suscripcion-badge {
    position: absolute;
    top: 16px;
    right: 16px;
    background: var(--lp-success);
    color: #fff;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

.lp-suscripcion-card h4 {
    font-size: 20px;
    font-weight: 700;
    margin: 0 0 16px;
    color: var(--lp-secondary);
}

.lp-suscripcion-card p {
    margin: 0 0 8px;
    color: var(--lp-text);
}

/* Puntos */
.lp-puntos-dashboard {
    text-align: center;
}

.lp-puntos-total {
    margin-bottom: 32px;
}

.lp-puntos-number {
    display: block;
    font-size: 64px;
    font-weight: 700;
    color: var(--lp-primary);
    line-height: 1;
}

.lp-puntos-label {
    display: block;
    font-size: 16px;
    color: var(--lp-text-light);
    margin-top: 8px;
}

.lp-puntos-list {
    list-style: none;
    padding: 0;
    margin: 16px 0 0;
    text-align: left;
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
}

.lp-puntos-list li {
    padding: 12px 0;
    border-bottom: 1px solid var(--lp-border);
    color: var(--lp-text);
}

.lp-puntos-list li:last-child {
    border-bottom: none;
}

/* Lector Stats */
.lp-lector-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 24px;
}

.lp-stat-item {
    text-align: center;
    padding: 24px;
    background: var(--lp-bg-light);
    border-radius: 8px;
}

.lp-stat-number {
    display: block;
    font-size: 36px;
    font-weight: 700;
    color: var(--lp-primary);
    margin-bottom: 8px;
}

.lp-stat-label {
    display: block;
    font-size: 14px;
    color: var(--lp-text-light);
}

/* Tabla de pagos */
.lp-table {
    width: 100%;
    border-collapse: collapse;
}

.lp-table th,
.lp-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid var(--lp-border);
}

.lp-table th {
    font-weight: 600;
    color: var(--lp-secondary);
    background: var(--lp-bg-light);
}

.lp-table td {
    color: var(--lp-text);
}

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

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

.lp-badge-pending {
    background: #fef3c7;
    color: #92400e;
}

/* Utilidades */
.lp-loading {
    color: var(--lp-text-light);
    text-align: center;
}

.lp-text-muted {
    color: var(--lp-text-light);
}

.lp-text-error {
    color: var(--lp-error);
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 768px) {
    .lp-newsauth-form-box {
        padding: 30px 24px;
    }
    
    .lp-planes-grid {
        grid-template-columns: 1fr;
    }
    
    .lp-cuenta-header {
        flex-direction: column;
        gap: 16px;
        align-items: flex-start;
    }
    
    .lp-cuenta-tabs {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .lp-modal-content {
        margin: 20px;
        max-height: calc(100vh - 40px);
    }
    
    .lp-modal-header,
    .lp-modal-body {
        padding: 24px 20px;
    }
    
    .lp-lector-stats {
        grid-template-columns: 1fr;
    }
    
    .lp-table {
        font-size: 14px;
    }
    
    .lp-table th,
    .lp-table td {
        padding: 8px;
    }
}
