/**
 * NewsAuth - Landing Pages CSS
 * Estilos para formularios, planes y widget de usuario
 */

/* ===========================================
   VARIABLES Y RESET
   =========================================== */
:root {
    --newsauth-primary: #1a73e8;
    --newsauth-primary-dark: #1557b0;
    --newsauth-success: #34a853;
    --newsauth-warning: #fbbc04;
    --newsauth-error: #ea4335;
    --newsauth-text: #202124;
    --newsauth-text-secondary: #5f6368;
    --newsauth-border: #dadce0;
    --newsauth-bg: #f8f9fa;
    --newsauth-white: #ffffff;
    --newsauth-shadow: 0 1px 3px rgba(0,0,0,0.12), 0 1px 2px rgba(0,0,0,0.24);
    --newsauth-shadow-hover: 0 3px 6px rgba(0,0,0,0.16), 0 3px 6px rgba(0,0,0,0.23);
    --newsauth-radius: 8px;
    --newsauth-transition: all 0.3s ease;
}

/* ===========================================
   CONTENEDORES DE FORMULARIOS
   =========================================== */
.newsauth-form-container {
    max-width: 420px;
    margin: 2rem auto;
    padding: 2rem;
    background: var(--newsauth-white);
    border-radius: var(--newsauth-radius);
    box-shadow: var(--newsauth-shadow);
}

.newsauth-form-title {
    text-align: center;
    margin: 0 0 1.5rem;
    font-size: 1.75rem;
    color: var(--newsauth-text);
}

.newsauth-benefits {
    background: var(--newsauth-bg);
    padding: 1rem;
    border-radius: var(--newsauth-radius);
    margin-bottom: 1.5rem;
}

.newsauth-benefits p {
    margin: 0.5rem 0;
    font-size: 0.9rem;
    color: var(--newsauth-text-secondary);
}

/* ===========================================
   FORMULARIOS
   =========================================== */
.newsauth-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.newsauth-field {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.newsauth-field label {
    font-weight: 500;
    font-size: 0.9rem;
    color: var(--newsauth-text);
}

.newsauth-field input[type="email"],
.newsauth-field input[type="password"],
.newsauth-field input[type="text"] {
    padding: 0.75rem 1rem;
    border: 1px solid var(--newsauth-border);
    border-radius: var(--newsauth-radius);
    font-size: 1rem;
    transition: var(--newsauth-transition);
}

.newsauth-field input:focus {
    outline: none;
    border-color: var(--newsauth-primary);
    box-shadow: 0 0 0 3px rgba(26, 115, 232, 0.1);
}

.newsauth-hint {
    font-size: 0.75rem;
    color: var(--newsauth-text-secondary);
}

.newsauth-remember,
.newsauth-terms {
    flex-direction: row !important;
    align-items: center;
    justify-content: space-between;
}

.newsauth-remember label,
.newsauth-terms label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 400;
    cursor: pointer;
}

.newsauth-link {
    color: var(--newsauth-primary);
    text-decoration: none;
    font-size: 0.85rem;
}

.newsauth-link:hover {
    text-decoration: underline;
}

/* ===========================================
   BOTONES
   =========================================== */
.newsauth-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: var(--newsauth-radius);
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--newsauth-transition);
    text-decoration: none;
}

.newsauth-btn-primary {
    background: var(--newsauth-primary);
    color: var(--newsauth-white);
}

.newsauth-btn-primary:hover {
    background: var(--newsauth-primary-dark);
    transform: translateY(-1px);
    box-shadow: var(--newsauth-shadow-hover);
}

.newsauth-btn-outline {
    background: transparent;
    color: var(--newsauth-primary);
    border: 2px solid var(--newsauth-primary);
}

.newsauth-btn-outline:hover {
    background: var(--newsauth-primary);
    color: var(--newsauth-white);
}

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

/* ===========================================
   BOTONES OAUTH
   =========================================== */
.newsauth-oauth-buttons {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.newsauth-btn-google {
    background: var(--newsauth-white);
    color: var(--newsauth-text);
    border: 1px solid var(--newsauth-border);
}

.newsauth-btn-google:hover {
    background: var(--newsauth-bg);
    box-shadow: var(--newsauth-shadow);
}

.newsauth-btn-apple {
    background: #000000;
    color: var(--newsauth-white);
}

.newsauth-btn-apple:hover {
    background: #333333;
}

.newsauth-divider {
    display: flex;
    align-items: center;
    margin: 1.5rem 0;
}

.newsauth-divider::before,
.newsauth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--newsauth-border);
}

.newsauth-divider span {
    padding: 0 1rem;
    font-size: 0.85rem;
    color: var(--newsauth-text-secondary);
}

/* ===========================================
   MENSAJES
   =========================================== */
.newsauth-message {
    padding: 0.75rem 1rem;
    border-radius: var(--newsauth-radius);
    font-size: 0.9rem;
    display: none;
}

.newsauth-message.success {
    display: block;
    background: #e6f4ea;
    color: var(--newsauth-success);
    border: 1px solid var(--newsauth-success);
}

.newsauth-message.error {
    display: block;
    background: #fce8e6;
    color: var(--newsauth-error);
    border: 1px solid var(--newsauth-error);
}

.newsauth-switch {
    text-align: center;
    margin-top: 1.5rem;
    font-size: 0.9rem;
    color: var(--newsauth-text-secondary);
}

.newsauth-switch a {
    color: var(--newsauth-primary);
    font-weight: 500;
}

/* ===========================================
   PLANES DE SUSCRIPCIÓN
   =========================================== */
.newsauth-planes-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    padding: 2rem 0;
    max-width: 1200px;
    margin: 0 auto;
}

.newsauth-planes-title {
    grid-column: 1 / -1;
    text-align: center;
    font-size: 2rem;
    margin-bottom: 1rem;
}

.newsauth-plan {
    background: var(--newsauth-white);
    border-radius: var(--newsauth-radius);
    padding: 1.5rem;
    box-shadow: var(--newsauth-shadow);
    display: flex;
    flex-direction: column;
    position: relative;
    transition: var(--newsauth-transition);
}

.newsauth-plan:hover {
    transform: translateY(-5px);
    box-shadow: var(--newsauth-shadow-hover);
}

.newsauth-plan-featured,
.newsauth-plan.destacado {
    border: 2px solid var(--newsauth-primary);
}

.plan-badge {
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--newsauth-primary);
    color: var(--newsauth-white);
    padding: 0.25rem 1rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}

.plan-header {
    text-align: center;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--newsauth-border);
    margin-bottom: 1rem;
}

.plan-header h3 {
    margin: 0 0 0.5rem;
    font-size: 1.25rem;
}

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

.plan-price .price {
    font-size: 2rem;
    font-weight: 700;
    color: var(--newsauth-text);
}

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

.plan-savings {
    font-size: 0.8rem;
    color: var(--newsauth-success);
    font-weight: 500;
    margin-top: 0.5rem;
}

.plan-features {
    list-style: none;
    padding: 0;
    margin: 0 0 1.5rem;
    flex-grow: 1;
}

.plan-features li {
    padding: 0.5rem 0;
    font-size: 0.9rem;
    color: var(--newsauth-text-secondary);
}

.newsauth-plan .newsauth-btn {
    width: 100%;
}

.newsauth-plan-free {
    background: var(--newsauth-bg);
}

.newsauth-plan-business {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    color: var(--newsauth-white);
}

.newsauth-plan-business .plan-header h3,
.newsauth-plan-business .plan-price .price,
.newsauth-plan-business .plan-features li {
    color: var(--newsauth-white);
}

/* ===========================================
   WIDGET DE USUARIO
   =========================================== */
.newsauth-widget {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.newsauth-widget-guest {
    display: flex;
    gap: 0.5rem;
}

.newsauth-widget-btn {
    padding: 0.5rem 1rem;
    border-radius: var(--newsauth-radius);
    font-size: 0.85rem;
    text-decoration: none;
    transition: var(--newsauth-transition);
    background: transparent;
    color: var(--newsauth-text);
    border: 1px solid var(--newsauth-border);
}

.newsauth-widget-btn:hover {
    background: var(--newsauth-bg);
}

.newsauth-widget-btn-primary {
    background: var(--newsauth-primary);
    color: var(--newsauth-white);
    border-color: var(--newsauth-primary);
}

.newsauth-widget-btn-primary:hover {
    background: var(--newsauth-primary-dark);
}

.newsauth-widget-user {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.newsauth-widget-stat {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.85rem;
    color: var(--newsauth-text-secondary);
}

.newsauth-widget-stat .stat-icon {
    font-size: 1rem;
}

.newsauth-widget-stat .stat-value {
    font-weight: 600;
}

.newsauth-widget-menu {
    position: relative;
}

.newsauth-widget-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--newsauth-primary);
    color: var(--newsauth-white);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    transition: var(--newsauth-transition);
}

.newsauth-widget-avatar:hover {
    transform: scale(1.1);
}

.newsauth-widget-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 0.5rem;
    background: var(--newsauth-white);
    border-radius: var(--newsauth-radius);
    box-shadow: var(--newsauth-shadow-hover);
    min-width: 180px;
    z-index: 1000;
    overflow: hidden;
}

.newsauth-widget-dropdown a {
    display: block;
    padding: 0.75rem 1rem;
    color: var(--newsauth-text);
    text-decoration: none;
    font-size: 0.9rem;
    transition: var(--newsauth-transition);
}

.newsauth-widget-dropdown a:hover {
    background: var(--newsauth-bg);
}

.newsauth-widget-dropdown a.highlight {
    color: var(--newsauth-primary);
    font-weight: 500;
}

.newsauth-widget-dropdown hr {
    margin: 0;
    border: none;
    border-top: 1px solid var(--newsauth-border);
}

/* ===========================================
   PÁGINA DE CUENTA
   =========================================== */
.newsauth-account-container {
    max-width: 800px;
    margin: 2rem auto;
    padding: 0 1rem;
}

.newsauth-account-header {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    padding: 2rem;
    background: var(--newsauth-white);
    border-radius: var(--newsauth-radius);
    box-shadow: var(--newsauth-shadow);
    margin-bottom: 1.5rem;
}

.account-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: var(--newsauth-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
}

.account-info h2 {
    margin: 0 0 0.5rem;
    font-size: 1.5rem;
}

.account-level {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--newsauth-text-secondary);
    margin: 0;
}

.newsauth-account-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.account-stat {
    background: var(--newsauth-white);
    padding: 1.5rem;
    border-radius: var(--newsauth-radius);
    box-shadow: var(--newsauth-shadow);
    text-align: center;
}

.account-stat .stat-value {
    display: block;
    font-size: 2rem;
    font-weight: 700;
    color: var(--newsauth-primary);
}

.account-stat .stat-label {
    font-size: 0.85rem;
    color: var(--newsauth-text-secondary);
}

/* Tabs */
.newsauth-account-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    border-bottom: 2px solid var(--newsauth-border);
    padding-bottom: 0;
}

.tab-btn {
    padding: 0.75rem 1.5rem;
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 0.9rem;
    color: var(--newsauth-text-secondary);
    position: relative;
    transition: var(--newsauth-transition);
}

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

.tab-btn.active {
    color: var(--newsauth-primary);
    font-weight: 600;
}

.tab-btn.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--newsauth-primary);
}

.tab-content {
    display: none;
    background: var(--newsauth-white);
    padding: 2rem;
    border-radius: var(--newsauth-radius);
    box-shadow: var(--newsauth-shadow);
}

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

.tab-content h3 {
    margin: 0 0 1rem;
    font-size: 1.25rem;
}

.points-guide {
    list-style: none;
    padding: 0;
    margin: 0;
}

.points-guide li {
    padding: 0.5rem 0;
    font-size: 0.9rem;
    color: var(--newsauth-text-secondary);
}

.progress-bar-container {
    height: 20px;
    background: var(--newsauth-bg);
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 0.5rem;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--newsauth-primary), var(--newsauth-success));
    border-radius: 10px;
    transition: width 0.5s ease;
}

.progress-text {
    font-size: 0.85rem;
    color: var(--newsauth-text-secondary);
}

/* ===========================================
   MODAL DE PAGO
   =========================================== */
.newsauth-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
}

.newsauth-modal-content {
    background: var(--newsauth-white);
    padding: 2rem;
    border-radius: var(--newsauth-radius);
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
}

.newsauth-modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--newsauth-text-secondary);
}

.newsauth-modal-close:hover {
    color: var(--newsauth-text);
}

/* ===========================================
   RESPONSIVE
   =========================================== */
@media (max-width: 768px) {
    .newsauth-form-container {
        margin: 1rem;
        padding: 1.5rem;
    }
    
    .newsauth-planes-container {
        grid-template-columns: 1fr;
        padding: 1rem;
    }
    
    .newsauth-account-header {
        flex-direction: column;
        text-align: center;
    }
    
    .newsauth-account-stats {
        grid-template-columns: 1fr;
    }
    
    .newsauth-account-tabs {
        overflow-x: auto;
        flex-wrap: nowrap;
    }
    
    .tab-btn {
        flex-shrink: 0;
        padding: 0.75rem 1rem;
    }
    
    .newsauth-widget-stat {
        display: none;
    }
    
    .newsauth-widget-stat:first-child {
        display: flex;
    }
}


/* ===========================================
   WIDGET - CONTROL DE VISIBILIDAD
   =========================================== */

/* Por defecto: mostrar versión visitante, ocultar versión user */
.newsauth-widget-guest {
    display: flex;
}

.newsauth-widget-user {
    display: none;
}

/* Cuando usuario está autenticado (nivel >= 1): ocultar guest, mostrar user */
body.user-nivel-1 .newsauth-widget-guest,
body.user-nivel-2 .newsauth-widget-guest,
body.user-nivel-3 .newsauth-widget-guest,
body.user-nivel-4 .newsauth-widget-guest,
body.user-nivel-5 .newsauth-widget-guest {
    display: none !important;
}

body.user-nivel-1 .newsauth-widget-user,
body.user-nivel-2 .newsauth-widget-user,
body.user-nivel-3 .newsauth-widget-user,
body.user-nivel-4 .newsauth-widget-user,
body.user-nivel-5 .newsauth-widget-user {
    display: flex !important;
}

/* Ocultar "Ser Premium" si ya es Premium (nivel 4 o 5) */
body.user-nivel-4 .widget-upgrade-link,
body.user-nivel-5 .widget-upgrade-link {
    display: none !important;
}
